<main>
    <div class="blog-content-box">
<div class="article-header-box">
<div class="article-header">
    <div class="article-title-box">
        <h1 class="title-article">SPI总线协议详解及STM32代码实现</h1>
    </div>
    <div class="article-info-box">
        <div class="article-bar-top">
            <!--文章类型-->
            <span class="article-type type-1 float-left">原创</span>                                                                                                                                            <a class="follow-nickName" href="https://me.csdn.net/renqingxin2011" target="_blank" rel="noopener">rqx19910206</a>
            <span class="time">最后发布于2019-06-13 15:38:16                    </span>
            <span class="read-count">阅读数 1096</span>
            <a id="blog_detail_zk_collection" data-report-click="{&quot;mod&quot;:&quot;popu_823&quot;}">
                <svg class="icon">
                    <use xlink:href="#icon-csdnc-Collection-G"></use>
                </svg>
                收藏
            </a>
                            </div>
                        <div class="up-time" style="left: 146.969px; display: none;">发布于2019-06-13 15:38:16</div>
        <div class="slide-content-box">
                                                                                                                                                            <div class="article-copyright">
                <span class="creativecommons">
                    <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"></a>
                    <span>
                        版权声明：本文为博主原创文章，遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议，转载请附上原文出处链接和本声明。                            </span>
                    <div class="article-source-link2222">
                        本文链接：<a href="https://blog.csdn.net/renqingxin2011/article/details/91047802">https://blog.csdn.net/renqingxin2011/article/details/91047802</a>
                    </div>
                </span> 
                </div>
                                                                        </div>
        <div class="operating">
                                                        <a class="href-article-edit slide-toggle">展开</a>
                            </div>
    </div>
</div>
</div>
<article class="baidu_pl">
<!--python安装手册开始-->
        <!--python安装手册结束-->
        <!--####专栏广告位图文切换开始-->
                            <!--####专栏广告位图文切换结束-->
 <div id="article_content" class="article_content clearfix">
    <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-833878f763.css">
                    <div id="content_views" class="markdown_views prism-atom-one-light">
            <!-- flowchart 箭头图标 勿删 -->
            <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
            </svg>
                                    <h2><a name="t0"></a><a name="t0"></a><a id="SPISTM32_0"></a>SPI总线协议详解及STM32代码实现</h2>
<ul>
<li class="task-list-item"><input disabled="" class="task-list-item-checkbox" type="checkbox"> <em><strong>SPI总线协议详解</strong></em></li>
<li class="task-list-item"><input disabled="" class="task-list-item-checkbox" type="checkbox"> <em><strong>STM32代码实现</strong></em><br>
<strong>本篇博客分为两部分。第一部分讲解SPI总线协议的实现，主要包括硬件连接、工作模式、时序等。第二部分讲解通过STM32以SPI的方式实现对Flash芯片W25Q128的读写，这其中采用了两种方式：第一种方式是采用STM32的GPIO模拟SPI时序的方式进行读写Flash芯片；另一种方式采用STM32片内自带的SPI外设进行读写Flash芯片。切入正题：</strong></li>
</ul>
<h3><a name="t1"></a><a name="t1"></a><a id="SPI_4"></a>一、SPI总线协议详解</h3>
<h4><a id="1SPI_5"></a>1、SPI协议硬件连接</h4>
<p>SPI，是英语Serial Peripheral interface的缩写。SPI主要用于MCU和一些外设进行通信的场合，例如：EEPROM、Flash、AD转换器等一些应用中。它是一种高速、全双工、同步的通信总线，这里全双工指的是可以在同一时刻设备进行接收和发送同时进行，它有别于CAN总线或者RS585总线，因为这些总线在同一时刻只能进行数据的单向传输。换句话说，对于一个设备在同一时刻只能接收或者发送数据。同步通信指的是一种比特同步通信技术，要求发收双方具有同频同相的同步时钟信号，SPI是通过CLK和相位实现这一点的。</p>
<ul>
<li>硬件连线<br>
在SPI总线中，一共规定了4条线，分别含义如下:<br>
<strong>SCLK</strong> —串行时钟同步输出，同步数据传输，使用主机输出；<br>
<strong>MOSI</strong> —主机输出从机输入，主机通过该线发送数据，从机通过该线接收数据；<br>
<strong>MISO</strong> —主机输入从机输出，主机通过该线接收数据，从机通过该线发送数据；<br>
<strong>SS</strong>  —片选，主机输出，用来选中具体的从机。<br>
<strong>注</strong>：（1）SPI会有主从机（或者对于MCU来说会有主模式，从模式）之分，它的区分依据是SCLK同步时钟和SS片选是由谁输出，输出方就会被定义为工作在主机（主模式）状态下。（2）如果在一个系统中只含有一个采用SPI通信的外设，那么我们可以将外设的<strong>SS</strong>引脚直接连接板子的<strong>GND</strong>引脚，这样使得外设始终被选中，从而节省了连接线。<br>
具体的SPI硬件接线图形式如下所示：<br>
（1）<strong>4线SPI接线</strong><br>
SPI主从设备之间接线如下图所示：<br>
<img src="https://img-blog.csdnimg.cn/20190613114027415.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>
（2）<strong>3线SPI接线</strong><br>
将从设备的<strong>SS</strong>引脚接地，实现3线SPI这样就可以节省芯片资源，减少布线。<img src="https://img-blog.csdnimg.cn/20190613114259408.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>
（3）<strong>一主多从SPI接线（1）</strong><br>
通过将每个从设备的<strong>SS</strong>引脚分别接到主模式设备，可以达到一个主设备控制多个从设备的目的。<br>
<img src="https://img-blog.csdnimg.cn/20190606172000964.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>
（4）<strong>一主多从SPI接线（2）</strong><br>
此方法中加入译码器，可以有效减少片选信号的数量，节省主模式设备的芯片引脚。<br>
<img src="https://img-blog.csdnimg.cn/20190606174356540.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></li>
</ul>
<h4><a id="2SPI_26"></a>2、SPI协议时序</h4>
<p><strong>SPI协议时序也被称为工作模式。</strong> SPI一共有四种工作模式，通常情况下，从机的工作模式是固定的，主机需要根据从机的工作模式进行调整自身工作模式，来完成相互之间的通信。SPI的四种工作模式是通过时钟极性（CPOL位）和时钟相位（CPHA位）进行确定的，对于具体的工作模式可以查看下表：<br>
<strong>注：</strong> CPOL时钟极性选择，=0表示总线空闲为低电平（SCLK时钟空闲状态为低电平，此时MOSI和MISO上的数据可以变化）；=1表示总线空闲位高电平（SCLK时钟空闲状态为低电平，此时MOSI和MISO上的数据可以变化）。<br>
<strong>注：</strong> CPHA时钟相位选择，=0会在SCLK的第一个跳变沿采样，第二个跳变沿输出；=1会在SCLK的第二个跳变沿采样，第一个跳变沿输出。以上说法不好理解，可以这样描述，=0时，在奇数跳变沿采样，偶数跳变沿输出；=1时，则正好相反。</p>

<div class="table-box"><table>
<thead>
<tr>
<th align="center">SPI模式</th>
<th align="center">CPOL</th>
<th align="center">CPHA</th>
<th align="center">空闲状态时钟极性</th>
<th align="center">采样跳变沿</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">0</td>
<td align="center">低电平</td>
<td align="center">奇数沿采样，偶数沿输出</td>
</tr>
<tr>
<td align="center">1</td>
<td align="center">0</td>
<td align="center">0-</td>
<td align="center">低电平</td>
<td align="center">奇数沿输出，偶数沿采样</td>
</tr>
<tr>
<td align="center">2</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">高电平</td>
<td align="center">偶数沿采样，奇数沿输出</td>
</tr>
<tr>
<td align="center">3</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">高电平</td>
<td align="center">奇数沿输出，偶数沿采样</td>
</tr>
</tbody>
</table></div><p>下面具体看一下各模式的时序图：<br>
<strong>（1）模式0：</strong><br>
从图中可以看出，空闲电平是低电平，采样边沿为奇数跳变沿，输出在偶数跳变沿。<br>
<img src="https://img-blog.csdnimg.cn/20190613140225566.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<p><strong>（2）模式1：</strong><br>
图中可以看出，空闲电平是低电平；奇数跳变沿输出，偶数跳变沿采样。<br>
<img src="https://img-blog.csdnimg.cn/20190613140412345.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"><br>
<strong>（3）模式2：</strong><br>
图中看出，空闲电平是高电平；在奇数跳变沿进行采样，偶数跳变沿进行输出。<br>
<img src="https://img-blog.csdnimg.cn/20190613143745467.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<p><strong>（4）模式3：</strong><br>
从图中可以看出，空闲电平是高电平，；在奇数跳变沿进行输出，在偶数跳变沿进行采样。<br>
<img src="https://img-blog.csdnimg.cn/20190613143930476.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3JlbnFpbmd4aW4yMDEx,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<h3><a name="t2"></a><a name="t2"></a><a id="STM32_52"></a>二、STM32代码实现</h3>
<p>本小节介绍使用STM32F1系列MCU对Flash芯片W25Q128进行读写。分别使用了GPIO模拟SPI通信协议和STM32自带的SPI片内外设进行读写。对于W25Q128芯片手册，可以自行到官网下载。</p>
<h4><a id="1GPIO_54"></a>1、GPIO模拟方式</h4>
<p>w25qxx_flash_io.h</p>
<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">#include "stm32f10x.h"

#define  SPI_CS_0     GPIO_ResetBits(GPIOB, GPIO_Pin_12) 
#define  SPI_CS_1     GPIO_SetBits(GPIOB, GPIO_Pin_12) 
#define  SPI_SCK_0    GPIO_ResetBits(GPIOB, GPIO_Pin_13) 
#define  SPI_SCK_1    GPIO_SetBits(GPIOB, GPIO_Pin_13) 
#define  SPI_MOSI_0   GPIO_ResetBits(GPIOB, GPIO_Pin_15) 
#define  SPI_MOSI_1   GPIO_SetBits(GPIOB, GPIO_Pin_15)

#define W25QX_ReadStatus       0x05      //读状态寄存器
#define W25QX_WriteStatus      0x01      //写状态寄存器
#define W25QX_ReadDATA8        0x03      //普读_数据
#define W25QX_FastRead         0x0B      //快读_数据
#define W25QX_DualOutput       0x3B      //快读_双输出
#define W25QX_Writepage        0x02      //写_数据_0~255个字节
#define W25QX_S_Erase          0x20      //扇区擦除4KB
#define W25QX_B_Erase          0xD8      //块区擦除64KB
#define W25QX_C_Erase          0xC7      //整片格式化
#define W25QX_PowerDown        0xB9      //待机
#define W25QX_PowerON_ID       0xAB      //开机或是读ID
#define W25QX_JEDEC_ID         0x9F      //十六位的JEDEC_ID
#define W25QX_WriteEnable      0x06      //写允许
#define W25QX_WriteDisable     0x04      //写禁止

void SPI_GPIO_Init(void);
void W25QXX_SectorErase(uint32_t Addre24);              
void W25QXX_Flash_Write_NoCheck(uint8_t * pbuf,uint32_t WriteAddr,uint16_t Len);
void W25QXX_Flash_Read(uint8_t* pbuf,uint32_t ReadAddr,uint16_t Len) ;
uint16_t W25QXX_ReadID(void);
<div class="hljs-button {2}" data-title="复制"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li></ul></pre>
<p>w25qxx_flash_io.c</p>
<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">#include "stm32f10x.h"
#include "w25qxx_flash_io.h"	
#include "delay.h"


/**************************************************************************************
* 描  述 : 初始化FLASH用SPI所用到的IO口
* 入  参 : 无
* 返回值 : 无
**************************************************************************************/
void SPI_GPIO_Init(void)
{
GPIO_InitTypeDef  GPIO_InitStructure;

//打开所用GPIO的时钟
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB , ENABLE); 

//配置的IO是PB12 PB13 PB15，SPI的CS CLK MOSI
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_15;                
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;           //推挽输出
GPIO_Init(GPIOB, &amp;GPIO_InitStructure);
//配置的IO是PB14，SPI的MISO
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;     //浮空输入
GPIO_Init(GPIOB, &amp;GPIO_InitStructure);
}

/**************************************************************************************
* 描  述 : 模拟SPI写入一个字节
* 入  参 : uint8_t date
* 返回值 : 无
**************************************************************************************/
void SPI_WriteByte(uint8_t date)
{
uint8_t temp,i;
temp = date;  

for (i = 0; i &lt; 8; i++) 
{
SPI_SCK_0;
if((temp&amp;0x80)==0x80)
{ SPI_MOSI_1; }
else 
{ SPI_MOSI_0; }
SPI_SCK_1 ;
temp &lt;&lt;= 1;
}
SPI_MOSI_0;                
}

/**************************************************************************************
* 描  述 : 模拟SPI读取一个字节
* 入  参 : 无
* 返回值 : 读取uint8_t数据
**************************************************************************************/
uint8_t SPI_ReadByte(void)
{
uint8_t temp=0;
uint8_t i,SDI;
          
for(i = 0; i &lt; 8; i++)
{
temp &lt;&lt;= 1;
SPI_SCK_0 ;        

SDI = GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_14);   //MISO接收数据
if(SDI) 
{temp++; }
SPI_SCK_1 ;
}
return(temp);
}

/**************************************************************************************
* 描  述 : 写使能（将WEL置位）
* 入  参 : 无
* 返回值 : 无
**************************************************************************************/
void WriteEnable  (void)
{
SPI_CS_0;
SPI_WriteByte(W25QX_WriteEnable);  
SPI_CS_1;
}

/**************************************************************************************
* 描  述 : 写禁止（将WEL清0）
* 入  参 : 无
* 返回值 : 无
**************************************************************************************/
void WriteDisable (void)
{
SPI_CS_0;
SPI_WriteByte(W25QX_WriteDisable);  
SPI_CS_1;
}

/************************************************************************************
功能描述：读取芯片ID
入口参数：无
返回值：不同的芯片，返回数值不同，具体如下面备注。
备注:      W25Q16的ID:0XEF14   W25Q32的ID:0XEF15 
   W25Q64的ID:0XEF16   W25Q128的ID:0XEF17  
*************************************************************************************/
uint16_t W25QXX_ReadID(void)
{
uint16_t Temp = 0;
uint8_t	Temp1 = 0;
uint8_t	Temp2 = 0;
SPI_CS_0;				    
SPI_WriteByte(0x90);        //发送读取ID命令	    
SPI_WriteByte(0x00); 	    
SPI_WriteByte(0x00); 	    
SPI_WriteByte(0x00); 	 			   
Temp1|=SPI_ReadByte();  
Temp2|=SPI_ReadByte();	
Temp = Temp1*256+Temp2;
SPI_CS_1;  			    
return Temp;
}

/************************************************************************************
功能描述：读取芯片的状态
入口参数：无
返回值：状态寄存器数据字节 
备注：芯片内部状态寄存器第0位=0表示空闲，0位=1表示忙 
*************************************************************************************/
uint8_t W25QXX_ReadStatus(void)
{
uint8_t status=0;
SPI_CS_0;
SPI_WriteByte(W25QX_ReadStatus);     // 0x05读取状态的命令字
status=SPI_ReadByte();                // 读取状态字节
SPI_CS_1;                             // 关闭片选
return status;
} 

/************************************************************************************
功能描述：写芯片的状态寄存器
入口参数：无
返回值：无 
备注：只有SPR,TB,BP2,BP1,BP0(bit 7,5,4,3,2)可以写!!!
*************************************************************************************/
void W25QXX_WriteStatus(uint8_t Status)
{
SPI_CS_0;
SPI_WriteByte(W25QX_WriteStatus);    // 0x01读取状态的命令字
SPI_WriteByte(Status);                // 写入一个字节
SPI_CS_1;                             // 关闭片选
}

/************************************************************************************
功能描述：在一页(0~65535)内写入少于256个字节的数据(在指定地址开始写入最大256字节的数据)
入口参数：pbuf:数据存储区  WriteAddr:开始写入的地址(24bit)  Len:要写入的字节数(最大256) 
返回值：无 
备注：Len:要写入的字节数,该数不应该超过该页的剩余字节数!!!  
*************************************************************************************/
void W25QXX_Flash_Write_Page(uint8_t* pbuf,uint32_t WriteAddr,uint16_t Len)
{
uint16_t i;
while(W25QXX_ReadStatus()&amp;0x01);           //判断是否忙
WriteEnable();                             //写使能
SPI_CS_0;                                  //使能器件   
SPI_WriteByte(W25QX_Writepage);             //发送写页命令
SPI_WriteByte((uint8_t)((WriteAddr)&gt;&gt;16));   //发送24bit地址   
SPI_WriteByte((uint8_t)((WriteAddr)&gt;&gt;8));   
SPI_WriteByte((uint8_t)WriteAddr);  
for(i=0;i&lt;Len;i++)                         //循环写数
{
SPI_WriteByte(*pbuf++);      
}
SPI_CS_1;                                  //取消片选
while(W25QXX_ReadStatus()&amp;0x01);           //等待写入结束   
}

/************************************************************************************
功能描述：在指定地址开始写入指定长度的数据
入口参数：pbuf:数据存储区  WriteAddr:开始写入的地址(24bit)  Len:要写入的字节数(最大65535)
返回值：无 
备注：必须确保所写的地址范围内的数据全部为0XFF,否则在非0XFF处写入的数据将失败! 
*************************************************************************************/
void W25QXX_Flash_Write_NoCheck(uint8_t * pbuf,uint32_t WriteAddr,uint16_t Len)
{
uint16_t PageLen;                    // 页内写入字节长度
PageLen=256-WriteAddr%256;           // 单页剩余的字节数 （单页剩余空间）
if(Len&lt;=PageLen) PageLen=Len;        // 不大于256 个字节
while(1)
{
W25QXX_Flash_Write_Page(pbuf,WriteAddr,PageLen);
if(PageLen==Len)break;           // 写入结束了
else
{
    pbuf+=PageLen;
    WriteAddr+=PageLen;
    Len-=PageLen;                //  减去已经写入了的字节数
    if(Len&gt;256)PageLen=256;      // 一次可以写入256 个字节
    else PageLen=Len;            // 不够256 个字节了
}
}
}

/************************************************************************************
功能描述：在指定地址开始读取指定长度的数据
入口参数：pbuf:数据存储区  ReadAddr:开始读取的地址(24bit)  Len:要读取的字节数(最大65535)
返回值：无 
*************************************************************************************/
void W25QXX_Flash_Read(uint8_t * pbuf,uint32_t ReadAddr,uint16_t Len)   
{
uint16_t i;  
while(W25QXX_ReadStatus()&amp;0x01);          // 判断是否忙                                                     
SPI_CS_0;                                 // 使能器件   
SPI_WriteByte(W25QX_ReadDATA8);            // 发送读取命令   
SPI_WriteByte((uint8_t)((ReadAddr)&gt;&gt;16));      // 发送24bit地址   
SPI_WriteByte((uint8_t)((ReadAddr)&gt;&gt;8));   
SPI_WriteByte((uint8_t)ReadAddr);  
for(i=0;i&lt;Len;i++)
{
*pbuf++=SPI_ReadByte();                // 读一个字节   
}
SPI_CS_1;                                 // 取消片选            
}  

/************************************************************************************
功能描述：擦除一个扇区( 4K扇擦除)
入口参数：uint32_t Addr24  扇区地址
返回值：无 
备注：擦除一个扇区的最少时间:150ms
*************************************************************************************/
void W25QXX_SectorErase(uint32_t Addr24) //擦除资料图示的4KB空间
{
uint8_t  Addr1;                    // 最低地址字节
uint8_t  Addr2;                    // 中间地址字节
uint8_t  Addr3;                    // 最高地址字节  
Addr1=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr2=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr3=Addr24;                      // 把地址拆开来  
while(W25QXX_ReadStatus()&amp;0x01);   // 判断是否忙   
WriteEnable();                     // 写允许
SPI_CS_0;
SPI_WriteByte(W25QX_S_Erase);       // 整扇擦除命令
SPI_WriteByte(Addr3);
SPI_WriteByte(Addr2);
SPI_WriteByte(Addr1);
SPI_CS_1;
while(W25QXX_ReadStatus()&amp;0x01);   // 等待擦除完成
}

/************************************************************************************
功能描述：擦除一块擦除( 64K)
入口参数：uint32_t Addr24  扇区地址
返回值：无 
*************************************************************************************/
void W25QXX_BlockErase(uint32_t Addr24)  //擦除资料图示的64KB空间
{
uint8_t Addr1;       // 最低地址字节
uint8_t Addr2;       // 中间地址字节
uint8_t Addr3;       // 最高地址字节  
Addr1=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr2=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr3=Addr24;                      // 把地址拆开来  
while(W25QXX_ReadStatus()&amp;0x01);   // 判断是否忙   
WriteEnable();                     // 写允许
SPI_CS_0;
SPI_WriteByte(W25QX_B_Erase);       // 整扇擦除命令
SPI_WriteByte(Addr3);
SPI_WriteByte(Addr2);
SPI_WriteByte(Addr1);
SPI_CS_1;
while(W25QXX_ReadStatus()&amp;0x01);   // 等待擦除完成
}

/************************************************************************************
功能描述：擦除整片芯片
入口参数：无
返回值：无 
备注：不同型号的芯片时间不一样 
*************************************************************************************/
void W25QXX_ChipErase(void)
{
while(W25QXX_ReadStatus()&amp;0x01);       // 判断是否忙   
WriteEnable();                         // 写允许
SPI_CS_0;
SPI_WriteByte(W25QX_C_Erase);          // 整片擦除命令
SPI_CS_1;                              // 从CS=1时开始执行擦除
while(W25QXX_ReadStatus()&amp;0x01);       // 等待擦除完成   
}

/*********************************END FILE********************************************/	

<div class="hljs-button {2}" data-title="复制"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li><li style="color: rgb(153, 153, 153);">34</li><li style="color: rgb(153, 153, 153);">35</li><li style="color: rgb(153, 153, 153);">36</li><li style="color: rgb(153, 153, 153);">37</li><li style="color: rgb(153, 153, 153);">38</li><li style="color: rgb(153, 153, 153);">39</li><li style="color: rgb(153, 153, 153);">40</li><li style="color: rgb(153, 153, 153);">41</li><li style="color: rgb(153, 153, 153);">42</li><li style="color: rgb(153, 153, 153);">43</li><li style="color: rgb(153, 153, 153);">44</li><li style="color: rgb(153, 153, 153);">45</li><li style="color: rgb(153, 153, 153);">46</li><li style="color: rgb(153, 153, 153);">47</li><li style="color: rgb(153, 153, 153);">48</li><li style="color: rgb(153, 153, 153);">49</li><li style="color: rgb(153, 153, 153);">50</li><li style="color: rgb(153, 153, 153);">51</li><li style="color: rgb(153, 153, 153);">52</li><li style="color: rgb(153, 153, 153);">53</li><li style="color: rgb(153, 153, 153);">54</li><li style="color: rgb(153, 153, 153);">55</li><li style="color: rgb(153, 153, 153);">56</li><li style="color: rgb(153, 153, 153);">57</li><li style="color: rgb(153, 153, 153);">58</li><li style="color: rgb(153, 153, 153);">59</li><li style="color: rgb(153, 153, 153);">60</li><li style="color: rgb(153, 153, 153);">61</li><li style="color: rgb(153, 153, 153);">62</li><li style="color: rgb(153, 153, 153);">63</li><li style="color: rgb(153, 153, 153);">64</li><li style="color: rgb(153, 153, 153);">65</li><li style="color: rgb(153, 153, 153);">66</li><li style="color: rgb(153, 153, 153);">67</li><li style="color: rgb(153, 153, 153);">68</li><li style="color: rgb(153, 153, 153);">69</li><li style="color: rgb(153, 153, 153);">70</li><li style="color: rgb(153, 153, 153);">71</li><li style="color: rgb(153, 153, 153);">72</li><li style="color: rgb(153, 153, 153);">73</li><li style="color: rgb(153, 153, 153);">74</li><li style="color: rgb(153, 153, 153);">75</li><li style="color: rgb(153, 153, 153);">76</li><li style="color: rgb(153, 153, 153);">77</li><li style="color: rgb(153, 153, 153);">78</li><li style="color: rgb(153, 153, 153);">79</li><li style="color: rgb(153, 153, 153);">80</li><li style="color: rgb(153, 153, 153);">81</li><li style="color: rgb(153, 153, 153);">82</li><li style="color: rgb(153, 153, 153);">83</li><li style="color: rgb(153, 153, 153);">84</li><li style="color: rgb(153, 153, 153);">85</li><li style="color: rgb(153, 153, 153);">86</li><li style="color: rgb(153, 153, 153);">87</li><li style="color: rgb(153, 153, 153);">88</li><li style="color: rgb(153, 153, 153);">89</li><li style="color: rgb(153, 153, 153);">90</li><li style="color: rgb(153, 153, 153);">91</li><li style="color: rgb(153, 153, 153);">92</li><li style="color: rgb(153, 153, 153);">93</li><li style="color: rgb(153, 153, 153);">94</li><li style="color: rgb(153, 153, 153);">95</li><li style="color: rgb(153, 153, 153);">96</li><li style="color: rgb(153, 153, 153);">97</li><li style="color: rgb(153, 153, 153);">98</li><li style="color: rgb(153, 153, 153);">99</li><li style="color: rgb(153, 153, 153);">100</li><li style="color: rgb(153, 153, 153);">101</li><li style="color: rgb(153, 153, 153);">102</li><li style="color: rgb(153, 153, 153);">103</li><li style="color: rgb(153, 153, 153);">104</li><li style="color: rgb(153, 153, 153);">105</li><li style="color: rgb(153, 153, 153);">106</li><li style="color: rgb(153, 153, 153);">107</li><li style="color: rgb(153, 153, 153);">108</li><li style="color: rgb(153, 153, 153);">109</li><li style="color: rgb(153, 153, 153);">110</li><li style="color: rgb(153, 153, 153);">111</li><li style="color: rgb(153, 153, 153);">112</li><li style="color: rgb(153, 153, 153);">113</li><li style="color: rgb(153, 153, 153);">114</li><li style="color: rgb(153, 153, 153);">115</li><li style="color: rgb(153, 153, 153);">116</li><li style="color: rgb(153, 153, 153);">117</li><li style="color: rgb(153, 153, 153);">118</li><li style="color: rgb(153, 153, 153);">119</li><li style="color: rgb(153, 153, 153);">120</li><li style="color: rgb(153, 153, 153);">121</li><li style="color: rgb(153, 153, 153);">122</li><li style="color: rgb(153, 153, 153);">123</li><li style="color: rgb(153, 153, 153);">124</li><li style="color: rgb(153, 153, 153);">125</li><li style="color: rgb(153, 153, 153);">126</li><li style="color: rgb(153, 153, 153);">127</li><li style="color: rgb(153, 153, 153);">128</li><li style="color: rgb(153, 153, 153);">129</li><li style="color: rgb(153, 153, 153);">130</li><li style="color: rgb(153, 153, 153);">131</li><li style="color: rgb(153, 153, 153);">132</li><li style="color: rgb(153, 153, 153);">133</li><li style="color: rgb(153, 153, 153);">134</li><li style="color: rgb(153, 153, 153);">135</li><li style="color: rgb(153, 153, 153);">136</li><li style="color: rgb(153, 153, 153);">137</li><li style="color: rgb(153, 153, 153);">138</li><li style="color: rgb(153, 153, 153);">139</li><li style="color: rgb(153, 153, 153);">140</li><li style="color: rgb(153, 153, 153);">141</li><li style="color: rgb(153, 153, 153);">142</li><li style="color: rgb(153, 153, 153);">143</li><li style="color: rgb(153, 153, 153);">144</li><li style="color: rgb(153, 153, 153);">145</li><li style="color: rgb(153, 153, 153);">146</li><li style="color: rgb(153, 153, 153);">147</li><li style="color: rgb(153, 153, 153);">148</li><li style="color: rgb(153, 153, 153);">149</li><li style="color: rgb(153, 153, 153);">150</li><li style="color: rgb(153, 153, 153);">151</li><li style="color: rgb(153, 153, 153);">152</li><li style="color: rgb(153, 153, 153);">153</li><li style="color: rgb(153, 153, 153);">154</li><li style="color: rgb(153, 153, 153);">155</li><li style="color: rgb(153, 153, 153);">156</li><li style="color: rgb(153, 153, 153);">157</li><li style="color: rgb(153, 153, 153);">158</li><li style="color: rgb(153, 153, 153);">159</li><li style="color: rgb(153, 153, 153);">160</li><li style="color: rgb(153, 153, 153);">161</li><li style="color: rgb(153, 153, 153);">162</li><li style="color: rgb(153, 153, 153);">163</li><li style="color: rgb(153, 153, 153);">164</li><li style="color: rgb(153, 153, 153);">165</li><li style="color: rgb(153, 153, 153);">166</li><li style="color: rgb(153, 153, 153);">167</li><li style="color: rgb(153, 153, 153);">168</li><li style="color: rgb(153, 153, 153);">169</li><li style="color: rgb(153, 153, 153);">170</li><li style="color: rgb(153, 153, 153);">171</li><li style="color: rgb(153, 153, 153);">172</li><li style="color: rgb(153, 153, 153);">173</li><li style="color: rgb(153, 153, 153);">174</li><li style="color: rgb(153, 153, 153);">175</li><li style="color: rgb(153, 153, 153);">176</li><li style="color: rgb(153, 153, 153);">177</li><li style="color: rgb(153, 153, 153);">178</li><li style="color: rgb(153, 153, 153);">179</li><li style="color: rgb(153, 153, 153);">180</li><li style="color: rgb(153, 153, 153);">181</li><li style="color: rgb(153, 153, 153);">182</li><li style="color: rgb(153, 153, 153);">183</li><li style="color: rgb(153, 153, 153);">184</li><li style="color: rgb(153, 153, 153);">185</li><li style="color: rgb(153, 153, 153);">186</li><li style="color: rgb(153, 153, 153);">187</li><li style="color: rgb(153, 153, 153);">188</li><li style="color: rgb(153, 153, 153);">189</li><li style="color: rgb(153, 153, 153);">190</li><li style="color: rgb(153, 153, 153);">191</li><li style="color: rgb(153, 153, 153);">192</li><li style="color: rgb(153, 153, 153);">193</li><li style="color: rgb(153, 153, 153);">194</li><li style="color: rgb(153, 153, 153);">195</li><li style="color: rgb(153, 153, 153);">196</li><li style="color: rgb(153, 153, 153);">197</li><li style="color: rgb(153, 153, 153);">198</li><li style="color: rgb(153, 153, 153);">199</li><li style="color: rgb(153, 153, 153);">200</li><li style="color: rgb(153, 153, 153);">201</li><li style="color: rgb(153, 153, 153);">202</li><li style="color: rgb(153, 153, 153);">203</li><li style="color: rgb(153, 153, 153);">204</li><li style="color: rgb(153, 153, 153);">205</li><li style="color: rgb(153, 153, 153);">206</li><li style="color: rgb(153, 153, 153);">207</li><li style="color: rgb(153, 153, 153);">208</li><li style="color: rgb(153, 153, 153);">209</li><li style="color: rgb(153, 153, 153);">210</li><li style="color: rgb(153, 153, 153);">211</li><li style="color: rgb(153, 153, 153);">212</li><li style="color: rgb(153, 153, 153);">213</li><li style="color: rgb(153, 153, 153);">214</li><li style="color: rgb(153, 153, 153);">215</li><li style="color: rgb(153, 153, 153);">216</li><li style="color: rgb(153, 153, 153);">217</li><li style="color: rgb(153, 153, 153);">218</li><li style="color: rgb(153, 153, 153);">219</li><li style="color: rgb(153, 153, 153);">220</li><li style="color: rgb(153, 153, 153);">221</li><li style="color: rgb(153, 153, 153);">222</li><li style="color: rgb(153, 153, 153);">223</li><li style="color: rgb(153, 153, 153);">224</li><li style="color: rgb(153, 153, 153);">225</li><li style="color: rgb(153, 153, 153);">226</li><li style="color: rgb(153, 153, 153);">227</li><li style="color: rgb(153, 153, 153);">228</li><li style="color: rgb(153, 153, 153);">229</li><li style="color: rgb(153, 153, 153);">230</li><li style="color: rgb(153, 153, 153);">231</li><li style="color: rgb(153, 153, 153);">232</li><li style="color: rgb(153, 153, 153);">233</li><li style="color: rgb(153, 153, 153);">234</li><li style="color: rgb(153, 153, 153);">235</li><li style="color: rgb(153, 153, 153);">236</li><li style="color: rgb(153, 153, 153);">237</li><li style="color: rgb(153, 153, 153);">238</li><li style="color: rgb(153, 153, 153);">239</li><li style="color: rgb(153, 153, 153);">240</li><li style="color: rgb(153, 153, 153);">241</li><li style="color: rgb(153, 153, 153);">242</li><li style="color: rgb(153, 153, 153);">243</li><li style="color: rgb(153, 153, 153);">244</li><li style="color: rgb(153, 153, 153);">245</li><li style="color: rgb(153, 153, 153);">246</li><li style="color: rgb(153, 153, 153);">247</li><li style="color: rgb(153, 153, 153);">248</li><li style="color: rgb(153, 153, 153);">249</li><li style="color: rgb(153, 153, 153);">250</li><li style="color: rgb(153, 153, 153);">251</li><li style="color: rgb(153, 153, 153);">252</li><li style="color: rgb(153, 153, 153);">253</li><li style="color: rgb(153, 153, 153);">254</li><li style="color: rgb(153, 153, 153);">255</li><li style="color: rgb(153, 153, 153);">256</li><li style="color: rgb(153, 153, 153);">257</li><li style="color: rgb(153, 153, 153);">258</li><li style="color: rgb(153, 153, 153);">259</li><li style="color: rgb(153, 153, 153);">260</li><li style="color: rgb(153, 153, 153);">261</li><li style="color: rgb(153, 153, 153);">262</li><li style="color: rgb(153, 153, 153);">263</li><li style="color: rgb(153, 153, 153);">264</li><li style="color: rgb(153, 153, 153);">265</li><li style="color: rgb(153, 153, 153);">266</li><li style="color: rgb(153, 153, 153);">267</li><li style="color: rgb(153, 153, 153);">268</li><li style="color: rgb(153, 153, 153);">269</li><li style="color: rgb(153, 153, 153);">270</li><li style="color: rgb(153, 153, 153);">271</li><li style="color: rgb(153, 153, 153);">272</li><li style="color: rgb(153, 153, 153);">273</li><li style="color: rgb(153, 153, 153);">274</li><li style="color: rgb(153, 153, 153);">275</li><li style="color: rgb(153, 153, 153);">276</li><li style="color: rgb(153, 153, 153);">277</li><li style="color: rgb(153, 153, 153);">278</li><li style="color: rgb(153, 153, 153);">279</li><li style="color: rgb(153, 153, 153);">280</li><li style="color: rgb(153, 153, 153);">281</li><li style="color: rgb(153, 153, 153);">282</li><li style="color: rgb(153, 153, 153);">283</li><li style="color: rgb(153, 153, 153);">284</li><li style="color: rgb(153, 153, 153);">285</li><li style="color: rgb(153, 153, 153);">286</li><li style="color: rgb(153, 153, 153);">287</li><li style="color: rgb(153, 153, 153);">288</li><li style="color: rgb(153, 153, 153);">289</li><li style="color: rgb(153, 153, 153);">290</li><li style="color: rgb(153, 153, 153);">291</li><li style="color: rgb(153, 153, 153);">292</li><li style="color: rgb(153, 153, 153);">293</li><li style="color: rgb(153, 153, 153);">294</li></ul></pre>
<h4><a id="2SPI_386"></a>2、自带SPI片内外设方式</h4>
<p>w25qxx_flash.h</p>
<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">#include "stm32f10x.h"

#define  SPI_CS_0     GPIO_ResetBits(GPIOB, GPIO_Pin_12) 
#define  SPI_CS_1     GPIO_SetBits(GPIOB, GPIO_Pin_12) 

#define W25QX_ReadStatus       0x05      //读状态寄存器
#define W25QX_WriteStatus      0x01      //写状态寄存器
#define W25QX_ReadDATA8        0x03      //普读_数据
#define W25QX_FastRead         0x0B      //快读_数据
#define W25QX_DualOutput       0x3B      //快读_双输出
#define W25QX_Writepage        0x02      //写_数据_0~255个字节
#define W25QX_S_Erase          0x20      //扇区擦除4KB
#define W25QX_B_Erase          0xD8      //块区擦除64KB
#define W25QX_C_Erase          0xC7      //整片格式化
#define W25QX_PowerDown        0xB9      //待机
#define W25QX_PowerON_ID       0xAB      //开机或是读ID
#define W25QX_JEDEC_ID         0x9F      //十六位的JEDEC_ID
#define W25QX_WriteEnable      0x06      //写允许
#define W25QX_WriteDisable     0x04      //写禁止

void SPI_GPIO_Init(void);
void SPI2_Init(void);
void W25QXX_SectorErase(uint32_t Addre24);              
void W25QXX_Flash_Write_NoCheck(uint8_t * pbuf,uint32_t WriteAddr,uint16_t Len);
void W25QXX_Flash_Read(uint8_t* pbuf,uint32_t ReadAddr,uint16_t Len) ;
uint16_t W25QXX_ReadID(void);
<div class="hljs-button {2}" data-title="复制"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li></ul></pre>
<p>w25qxx_flash.c</p>
<pre class="prettyprint"><code class="prism language-c has-numbering" onclick="mdcp.copyCode(event)" style="position: unset;">#include "stm32f10x.h"
#include "w25qxx_flash.h"	
#include "delay.h"


/**************************************************************************************
* 描  述 : 初始化FLASH用SPI所用到的IO口
* 入  参 : 无
* 返回值 : 无
**************************************************************************************/
void SPI_GPIO_Init(void)
{
GPIO_InitTypeDef  GPIO_InitStructure;

//打开所用GPIO的时钟
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB , ENABLE); 

//配置的IO是PB12，SPI的CS
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 ;                
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;           //推挽输出
GPIO_Init(GPIOB, &amp;GPIO_InitStructure);
//配置的IO是PB13 PB15，SPI的CLK MOSI
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;                
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;           //复用推挽输出
GPIO_Init(GPIOB, &amp;GPIO_InitStructure);
//配置的IO是PB14，SPI的MISO
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;     //浮空输入
GPIO_Init(GPIOB, &amp;GPIO_InitStructure);

GPIO_SetBits(GPIOB,GPIO_Pin_12);                          //该步不可少！！！

}

/***************************************************************************
* 描  述 : SPI2读写数据函数，读写一个字节
* 入  参 : Dat：写入的数据
* 返回值 : 读取的数据
**************************************************************************/
uint8_t SPI2_ReadWriteByte(uint8_t Dat)                                       
{		
uint8_t retry=0;				 	
/* Loop while DR register in not emplty */
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET)      //发送缓存标志位为空
{
retry++;
if(retry&gt;200)return 0;
}			  
SPI_I2S_SendData(SPI2, Dat);                                        //通过外设SPI2发送一个数据
retry=0;
/* Wait to receive a byte */
while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET)     //接收缓存标志位不为空
{
retry++;
if(retry&gt;200)return 0;
}	  						    
/* Return the byte read from the SPI bus */
return SPI_I2S_ReceiveData(SPI2);                                   //通过SPI2返回接收数据				    
}

/***************************************************************************
* 描  述 : 配置SPI2总线
* 入  参 : 无
* 返回值 : 无
**************************************************************************/
void SPI2_Init(void)
{	 
SPI_InitTypeDef  SPI_InitStructure;

// Enable SPI2 and GPIO clocks
RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE); //SPI2时钟使能

SPI_Cmd(SPI2, DISABLE); 
/* SPI2 configuration */                                              //初始化SPI结构体
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;    //SPI设置为双线全双工
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;		                      //设置SPI为主模式
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;		                  //SPI发送接收8位帧结构
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;		                        //SPI时钟空闲时为低电平
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;	                        //第一个时钟沿开始采样数据
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;		                          //NSS信号由软件（使用SSI位）管理
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32;   //SPI2波特率预分频值为32
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;	                  //数据传输从MSB位开始
SPI_InitStructure.SPI_CRCPolynomial = 7;	                            //CRC值计算的多项式


SPI_Init(SPI2, &amp;SPI_InitStructure);      //根据SPI_InitStruct中指定的参数初始化外设SPI2寄存器
SPI_Cmd(SPI2, ENABLE);                   //使能SPI2外设
SPI2_ReadWriteByte(0xff);                //启动传输	
} 

/**************************************************************************************
* 描  述 : 写使能（将WEL置位）
* 入  参 : 无
* 返回值 : 无
**************************************************************************************/
void WriteEnable  (void)
{
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_WriteEnable);  
SPI_CS_1;
}

/**************************************************************************************
* 描  述 : 写禁止（将WEL清0）
* 入  参 : 无
* 返回值 : 无
**************************************************************************************/
void WriteDisable (void)
{
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_WriteDisable);  
SPI_CS_1;
}

/************************************************************************************
功能描述：读取芯片ID
入口参数：无
返回值：不同的芯片，返回数值不同，具体如下面备注。
备注:      W25Q16的ID:0XEF14   W25Q32的ID:0XEF15 
   W25Q64的ID:0XEF16   W25Q128的ID:0XEF17  
*************************************************************************************/
uint16_t W25QXX_ReadID(void)
{
uint16_t Temp = 0;
uint8_t	Temp1 = 0;
uint8_t	Temp2 = 0;
SPI_CS_0;				    
SPI2_ReadWriteByte(0x90);        //发送读取ID命令	    
SPI2_ReadWriteByte(0x00); 	    
SPI2_ReadWriteByte(0x00); 	    
SPI2_ReadWriteByte(0x00); 	
Temp1|=SPI2_ReadWriteByte(0xFF);  
Temp2|=SPI2_ReadWriteByte(0xFF);	
Temp = Temp1*256+Temp2;
SPI_CS_1;  			    
return Temp;
}

/************************************************************************************
功能描述：读取芯片的状态
入口参数：无
返回值：状态寄存器数据字节 
备注：芯片内部状态寄存器第0位=0表示空闲，0位=1表示忙 
*************************************************************************************/
uint8_t W25QXX_ReadStatus(void)
{
uint8_t status=0;
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_ReadStatus);     // 0x05读取状态的命令字
status=SPI2_ReadWriteByte(0xFF);          // 读取状态字节
SPI_CS_1;                                 // 关闭片选
return status;
} 

/************************************************************************************
功能描述：写芯片的状态寄存器
入口参数：无
返回值：无 
备注：只有SPR,TB,BP2,BP1,BP0(bit 7,5,4,3,2)可以写!!!
*************************************************************************************/
void W25QXX_WriteStatus(uint8_t Status)
{
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_WriteStatus);    // 0x01读取状态的命令字
SPI2_ReadWriteByte(Status);               // 写入一个字节
SPI_CS_1;                                 // 关闭片选
}

/************************************************************************************
功能描述：在一页(0~65535)内写入少于256个字节的数据(在指定地址开始写入最大256字节的数据)
入口参数：pbuf:数据存储区  WriteAddr:开始写入的地址(24bit)  Len:要写入的字节数(最大256) 
返回值：无 
备注：Len:要写入的字节数,该数不应该超过该页的剩余字节数!!!  
*************************************************************************************/
void W25QXX_Flash_Write_Page(uint8_t* pbuf,uint32_t WriteAddr,uint16_t Len)
{
uint16_t i;
while(W25QXX_ReadStatus()&amp;0x01);           //判断是否忙
WriteEnable();                             //写使能
SPI_CS_0;                                  //使能器件   
SPI2_ReadWriteByte(W25QX_Writepage);             //发送写页命令
SPI2_ReadWriteByte((uint8_t)((WriteAddr)&gt;&gt;16));   //发送24bit地址   
SPI2_ReadWriteByte((uint8_t)((WriteAddr)&gt;&gt;8));   
SPI2_ReadWriteByte((uint8_t)WriteAddr);  
for(i=0;i&lt;Len;i++)                         //循环写数
{
SPI2_ReadWriteByte(*pbuf++);      
}
SPI_CS_1;                                  //取消片选
while(W25QXX_ReadStatus()&amp;0x01);           //等待写入结束   
}

/************************************************************************************
功能描述：在指定地址开始写入指定长度的数据
入口参数：pbuf:数据存储区  WriteAddr:开始写入的地址(24bit)  Len:要写入的字节数(最大65535)
返回值：无 
备注：必须确保所写的地址范围内的数据全部为0XFF,否则在非0XFF处写入的数据将失败! 
*************************************************************************************/
void W25QXX_Flash_Write_NoCheck(uint8_t * pbuf,uint32_t WriteAddr,uint16_t Len)
{
uint16_t PageLen;                    // 页内写入字节长度
PageLen=256-WriteAddr%256;           // 单页剩余的字节数 （单页剩余空间）
if(Len&lt;=PageLen) PageLen=Len;        // 不大于256 个字节
while(1)
{
W25QXX_Flash_Write_Page(pbuf,WriteAddr,PageLen);
if(PageLen==Len)break;           // 写入结束了
else
{
    pbuf+=PageLen;
    WriteAddr+=PageLen;
    Len-=PageLen;                //  减去已经写入了的字节数
    if(Len&gt;256)PageLen=256;      // 一次可以写入256 个字节
    else PageLen=Len;            // 不够256 个字节了
}
}
}

/************************************************************************************
功能描述：在指定地址开始读取指定长度的数据
入口参数：pbuf:数据存储区  ReadAddr:开始读取的地址(24bit)  Len:要读取的字节数(最大65535)
返回值：无 
*************************************************************************************/
void W25QXX_Flash_Read(uint8_t * pbuf,uint32_t ReadAddr,uint16_t Len)   
{
uint16_t i;  
while(W25QXX_ReadStatus()&amp;0x01);                    // 判断是否忙                                                     
SPI_CS_0;                                           // 使能器件   
SPI2_ReadWriteByte(W25QX_ReadDATA8);                // 发送读取命令   
SPI2_ReadWriteByte((uint8_t)((ReadAddr)&gt;&gt;16));      // 发送24bit地址   
SPI2_ReadWriteByte((uint8_t)((ReadAddr)&gt;&gt;8));   
SPI2_ReadWriteByte((uint8_t)ReadAddr);  
for(i=0;i&lt;Len;i++)
{
*pbuf++=SPI2_ReadWriteByte(0xFF);                // 读一个字节   
}
SPI_CS_1;                                           // 取消片选            
}  

/************************************************************************************
功能描述：擦除一个扇区( 4K扇擦除)
入口参数：uint32_t Addr24  扇区地址
返回值：无 
备注：擦除一个扇区的最少时间:150ms
*************************************************************************************/
void W25QXX_SectorErase(uint32_t Addr24) //擦除资料图示的4KB空间
{
uint8_t  Addr1;                    // 最低地址字节
uint8_t  Addr2;                    // 中间地址字节
uint8_t  Addr3;                    // 最高地址字节  
Addr1=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr2=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr3=Addr24;                      // 把地址拆开来  
while(W25QXX_ReadStatus()&amp;0x01);   // 判断是否忙   
WriteEnable();                     // 写允许
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_S_Erase);       // 整扇擦除命令
SPI2_ReadWriteByte(Addr3);
SPI2_ReadWriteByte(Addr2);
SPI2_ReadWriteByte(Addr1);
SPI_CS_1;
while(W25QXX_ReadStatus()&amp;0x01);   // 等待擦除完成
}

/************************************************************************************
功能描述：擦除一块擦除( 64K)
入口参数：uint32_t Addr24  扇区地址
返回值：无 
*************************************************************************************/
void W25QXX_BlockErase(uint32_t Addr24)  //擦除资料图示的64KB空间
{
uint8_t Addr1;       // 最低地址字节
uint8_t Addr2;       // 中间地址字节
uint8_t Addr3;       // 最高地址字节  
Addr1=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr2=Addr24;
Addr24=Addr24&gt;&gt;8;
Addr3=Addr24;                      // 把地址拆开来  
while(W25QXX_ReadStatus()&amp;0x01);   // 判断是否忙   
WriteEnable();                     // 写允许
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_B_Erase);       // 整扇擦除命令
SPI2_ReadWriteByte(Addr3);
SPI2_ReadWriteByte(Addr2);
SPI2_ReadWriteByte(Addr1);
SPI_CS_1;
while(W25QXX_ReadStatus()&amp;0x01);   // 等待擦除完成
}

/************************************************************************************
功能描述：擦除整片芯片
入口参数：无
返回值：无 
备注：不同型号的芯片时间不一样 
*************************************************************************************/
void W25QXX_ChipErase(void)
{
while(W25QXX_ReadStatus()&amp;0x01);       // 判断是否忙   
WriteEnable();                         // 写允许
SPI_CS_0;
SPI2_ReadWriteByte(W25QX_C_Erase);     // 整片擦除命令
SPI_CS_1;                              // 从CS=1时开始执行擦除
while(W25QXX_ReadStatus()&amp;0x01);       // 等待擦除完成   
}

/*********************************END FILE********************************************/	

<div class="hljs-button {2}" data-title="复制"></div></code><ul class="pre-numbering" style=""><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li><li style="color: rgb(153, 153, 153);">34</li><li style="color: rgb(153, 153, 153);">35</li><li style="color: rgb(153, 153, 153);">36</li><li style="color: rgb(153, 153, 153);">37</li><li style="color: rgb(153, 153, 153);">38</li><li style="color: rgb(153, 153, 153);">39</li><li style="color: rgb(153, 153, 153);">40</li><li style="color: rgb(153, 153, 153);">41</li><li style="color: rgb(153, 153, 153);">42</li><li style="color: rgb(153, 153, 153);">43</li><li style="color: rgb(153, 153, 153);">44</li><li style="color: rgb(153, 153, 153);">45</li><li style="color: rgb(153, 153, 153);">46</li><li style="color: rgb(153, 153, 153);">47</li><li style="color: rgb(153, 153, 153);">48</li><li style="color: rgb(153, 153, 153);">49</li><li style="color: rgb(153, 153, 153);">50</li><li style="color: rgb(153, 153, 153);">51</li><li style="color: rgb(153, 153, 153);">52</li><li style="color: rgb(153, 153, 153);">53</li><li style="color: rgb(153, 153, 153);">54</li><li style="color: rgb(153, 153, 153);">55</li><li style="color: rgb(153, 153, 153);">56</li><li style="color: rgb(153, 153, 153);">57</li><li style="color: rgb(153, 153, 153);">58</li><li style="color: rgb(153, 153, 153);">59</li><li style="color: rgb(153, 153, 153);">60</li><li style="color: rgb(153, 153, 153);">61</li><li style="color: rgb(153, 153, 153);">62</li><li style="color: rgb(153, 153, 153);">63</li><li style="color: rgb(153, 153, 153);">64</li><li style="color: rgb(153, 153, 153);">65</li><li style="color: rgb(153, 153, 153);">66</li><li style="color: rgb(153, 153, 153);">67</li><li style="color: rgb(153, 153, 153);">68</li><li style="color: rgb(153, 153, 153);">69</li><li style="color: rgb(153, 153, 153);">70</li><li style="color: rgb(153, 153, 153);">71</li><li style="color: rgb(153, 153, 153);">72</li><li style="color: rgb(153, 153, 153);">73</li><li style="color: rgb(153, 153, 153);">74</li><li style="color: rgb(153, 153, 153);">75</li><li style="color: rgb(153, 153, 153);">76</li><li style="color: rgb(153, 153, 153);">77</li><li style="color: rgb(153, 153, 153);">78</li><li style="color: rgb(153, 153, 153);">79</li><li style="color: rgb(153, 153, 153);">80</li><li style="color: rgb(153, 153, 153);">81</li><li style="color: rgb(153, 153, 153);">82</li><li style="color: rgb(153, 153, 153);">83</li><li style="color: rgb(153, 153, 153);">84</li><li style="color: rgb(153, 153, 153);">85</li><li style="color: rgb(153, 153, 153);">86</li><li style="color: rgb(153, 153, 153);">87</li><li style="color: rgb(153, 153, 153);">88</li><li style="color: rgb(153, 153, 153);">89</li><li style="color: rgb(153, 153, 153);">90</li><li style="color: rgb(153, 153, 153);">91</li><li style="color: rgb(153, 153, 153);">92</li><li style="color: rgb(153, 153, 153);">93</li><li style="color: rgb(153, 153, 153);">94</li><li style="color: rgb(153, 153, 153);">95</li><li style="color: rgb(153, 153, 153);">96</li><li style="color: rgb(153, 153, 153);">97</li><li style="color: rgb(153, 153, 153);">98</li><li style="color: rgb(153, 153, 153);">99</li><li style="color: rgb(153, 153, 153);">100</li><li style="color: rgb(153, 153, 153);">101</li><li style="color: rgb(153, 153, 153);">102</li><li style="color: rgb(153, 153, 153);">103</li><li style="color: rgb(153, 153, 153);">104</li><li style="color: rgb(153, 153, 153);">105</li><li style="color: rgb(153, 153, 153);">106</li><li style="color: rgb(153, 153, 153);">107</li><li style="color: rgb(153, 153, 153);">108</li><li style="color: rgb(153, 153, 153);">109</li><li style="color: rgb(153, 153, 153);">110</li><li style="color: rgb(153, 153, 153);">111</li><li style="color: rgb(153, 153, 153);">112</li><li style="color: rgb(153, 153, 153);">113</li><li style="color: rgb(153, 153, 153);">114</li><li style="color: rgb(153, 153, 153);">115</li><li style="color: rgb(153, 153, 153);">116</li><li style="color: rgb(153, 153, 153);">117</li><li style="color: rgb(153, 153, 153);">118</li><li style="color: rgb(153, 153, 153);">119</li><li style="color: rgb(153, 153, 153);">120</li><li style="color: rgb(153, 153, 153);">121</li><li style="color: rgb(153, 153, 153);">122</li><li style="color: rgb(153, 153, 153);">123</li><li style="color: rgb(153, 153, 153);">124</li><li style="color: rgb(153, 153, 153);">125</li><li style="color: rgb(153, 153, 153);">126</li><li style="color: rgb(153, 153, 153);">127</li><li style="color: rgb(153, 153, 153);">128</li><li style="color: rgb(153, 153, 153);">129</li><li style="color: rgb(153, 153, 153);">130</li><li style="color: rgb(153, 153, 153);">131</li><li style="color: rgb(153, 153, 153);">132</li><li style="color: rgb(153, 153, 153);">133</li><li style="color: rgb(153, 153, 153);">134</li><li style="color: rgb(153, 153, 153);">135</li><li style="color: rgb(153, 153, 153);">136</li><li style="color: rgb(153, 153, 153);">137</li><li style="color: rgb(153, 153, 153);">138</li><li style="color: rgb(153, 153, 153);">139</li><li style="color: rgb(153, 153, 153);">140</li><li style="color: rgb(153, 153, 153);">141</li><li style="color: rgb(153, 153, 153);">142</li><li style="color: rgb(153, 153, 153);">143</li><li style="color: rgb(153, 153, 153);">144</li><li style="color: rgb(153, 153, 153);">145</li><li style="color: rgb(153, 153, 153);">146</li><li style="color: rgb(153, 153, 153);">147</li><li style="color: rgb(153, 153, 153);">148</li><li style="color: rgb(153, 153, 153);">149</li><li style="color: rgb(153, 153, 153);">150</li><li style="color: rgb(153, 153, 153);">151</li><li style="color: rgb(153, 153, 153);">152</li><li style="color: rgb(153, 153, 153);">153</li><li style="color: rgb(153, 153, 153);">154</li><li style="color: rgb(153, 153, 153);">155</li><li style="color: rgb(153, 153, 153);">156</li><li style="color: rgb(153, 153, 153);">157</li><li style="color: rgb(153, 153, 153);">158</li><li style="color: rgb(153, 153, 153);">159</li><li style="color: rgb(153, 153, 153);">160</li><li style="color: rgb(153, 153, 153);">161</li><li style="color: rgb(153, 153, 153);">162</li><li style="color: rgb(153, 153, 153);">163</li><li style="color: rgb(153, 153, 153);">164</li><li style="color: rgb(153, 153, 153);">165</li><li style="color: rgb(153, 153, 153);">166</li><li style="color: rgb(153, 153, 153);">167</li><li style="color: rgb(153, 153, 153);">168</li><li style="color: rgb(153, 153, 153);">169</li><li style="color: rgb(153, 153, 153);">170</li><li style="color: rgb(153, 153, 153);">171</li><li style="color: rgb(153, 153, 153);">172</li><li style="color: rgb(153, 153, 153);">173</li><li style="color: rgb(153, 153, 153);">174</li><li style="color: rgb(153, 153, 153);">175</li><li style="color: rgb(153, 153, 153);">176</li><li style="color: rgb(153, 153, 153);">177</li><li style="color: rgb(153, 153, 153);">178</li><li style="color: rgb(153, 153, 153);">179</li><li style="color: rgb(153, 153, 153);">180</li><li style="color: rgb(153, 153, 153);">181</li><li style="color: rgb(153, 153, 153);">182</li><li style="color: rgb(153, 153, 153);">183</li><li style="color: rgb(153, 153, 153);">184</li><li style="color: rgb(153, 153, 153);">185</li><li style="color: rgb(153, 153, 153);">186</li><li style="color: rgb(153, 153, 153);">187</li><li style="color: rgb(153, 153, 153);">188</li><li style="color: rgb(153, 153, 153);">189</li><li style="color: rgb(153, 153, 153);">190</li><li style="color: rgb(153, 153, 153);">191</li><li style="color: rgb(153, 153, 153);">192</li><li style="color: rgb(153, 153, 153);">193</li><li style="color: rgb(153, 153, 153);">194</li><li style="color: rgb(153, 153, 153);">195</li><li style="color: rgb(153, 153, 153);">196</li><li style="color: rgb(153, 153, 153);">197</li><li style="color: rgb(153, 153, 153);">198</li><li style="color: rgb(153, 153, 153);">199</li><li style="color: rgb(153, 153, 153);">200</li><li style="color: rgb(153, 153, 153);">201</li><li style="color: rgb(153, 153, 153);">202</li><li style="color: rgb(153, 153, 153);">203</li><li style="color: rgb(153, 153, 153);">204</li><li style="color: rgb(153, 153, 153);">205</li><li style="color: rgb(153, 153, 153);">206</li><li style="color: rgb(153, 153, 153);">207</li><li style="color: rgb(153, 153, 153);">208</li><li style="color: rgb(153, 153, 153);">209</li><li style="color: rgb(153, 153, 153);">210</li><li style="color: rgb(153, 153, 153);">211</li><li style="color: rgb(153, 153, 153);">212</li><li style="color: rgb(153, 153, 153);">213</li><li style="color: rgb(153, 153, 153);">214</li><li style="color: rgb(153, 153, 153);">215</li><li style="color: rgb(153, 153, 153);">216</li><li style="color: rgb(153, 153, 153);">217</li><li style="color: rgb(153, 153, 153);">218</li><li style="color: rgb(153, 153, 153);">219</li><li style="color: rgb(153, 153, 153);">220</li><li style="color: rgb(153, 153, 153);">221</li><li style="color: rgb(153, 153, 153);">222</li><li style="color: rgb(153, 153, 153);">223</li><li style="color: rgb(153, 153, 153);">224</li><li style="color: rgb(153, 153, 153);">225</li><li style="color: rgb(153, 153, 153);">226</li><li style="color: rgb(153, 153, 153);">227</li><li style="color: rgb(153, 153, 153);">228</li><li style="color: rgb(153, 153, 153);">229</li><li style="color: rgb(153, 153, 153);">230</li><li style="color: rgb(153, 153, 153);">231</li><li style="color: rgb(153, 153, 153);">232</li><li style="color: rgb(153, 153, 153);">233</li><li style="color: rgb(153, 153, 153);">234</li><li style="color: rgb(153, 153, 153);">235</li><li style="color: rgb(153, 153, 153);">236</li><li style="color: rgb(153, 153, 153);">237</li><li style="color: rgb(153, 153, 153);">238</li><li style="color: rgb(153, 153, 153);">239</li><li style="color: rgb(153, 153, 153);">240</li><li style="color: rgb(153, 153, 153);">241</li><li style="color: rgb(153, 153, 153);">242</li><li style="color: rgb(153, 153, 153);">243</li><li style="color: rgb(153, 153, 153);">244</li><li style="color: rgb(153, 153, 153);">245</li><li style="color: rgb(153, 153, 153);">246</li><li style="color: rgb(153, 153, 153);">247</li><li style="color: rgb(153, 153, 153);">248</li><li style="color: rgb(153, 153, 153);">249</li><li style="color: rgb(153, 153, 153);">250</li><li style="color: rgb(153, 153, 153);">251</li><li style="color: rgb(153, 153, 153);">252</li><li style="color: rgb(153, 153, 153);">253</li><li style="color: rgb(153, 153, 153);">254</li><li style="color: rgb(153, 153, 153);">255</li><li style="color: rgb(153, 153, 153);">256</li><li style="color: rgb(153, 153, 153);">257</li><li style="color: rgb(153, 153, 153);">258</li><li style="color: rgb(153, 153, 153);">259</li><li style="color: rgb(153, 153, 153);">260</li><li style="color: rgb(153, 153, 153);">261</li><li style="color: rgb(153, 153, 153);">262</li><li style="color: rgb(153, 153, 153);">263</li><li style="color: rgb(153, 153, 153);">264</li><li style="color: rgb(153, 153, 153);">265</li><li style="color: rgb(153, 153, 153);">266</li><li style="color: rgb(153, 153, 153);">267</li><li style="color: rgb(153, 153, 153);">268</li><li style="color: rgb(153, 153, 153);">269</li><li style="color: rgb(153, 153, 153);">270</li><li style="color: rgb(153, 153, 153);">271</li><li style="color: rgb(153, 153, 153);">272</li><li style="color: rgb(153, 153, 153);">273</li><li style="color: rgb(153, 153, 153);">274</li><li style="color: rgb(153, 153, 153);">275</li><li style="color: rgb(153, 153, 153);">276</li><li style="color: rgb(153, 153, 153);">277</li><li style="color: rgb(153, 153, 153);">278</li><li style="color: rgb(153, 153, 153);">279</li><li style="color: rgb(153, 153, 153);">280</li><li style="color: rgb(153, 153, 153);">281</li><li style="color: rgb(153, 153, 153);">282</li><li style="color: rgb(153, 153, 153);">283</li><li style="color: rgb(153, 153, 153);">284</li><li style="color: rgb(153, 153, 153);">285</li><li style="color: rgb(153, 153, 153);">286</li><li style="color: rgb(153, 153, 153);">287</li><li style="color: rgb(153, 153, 153);">288</li><li style="color: rgb(153, 153, 153);">289</li><li style="color: rgb(153, 153, 153);">290</li><li style="color: rgb(153, 153, 153);">291</li><li style="color: rgb(153, 153, 153);">292</li><li style="color: rgb(153, 153, 153);">293</li><li style="color: rgb(153, 153, 153);">294</li><li style="color: rgb(153, 153, 153);">295</li><li style="color: rgb(153, 153, 153);">296</li><li style="color: rgb(153, 153, 153);">297</li><li style="color: rgb(153, 153, 153);">298</li><li style="color: rgb(153, 153, 153);">299</li><li style="color: rgb(153, 153, 153);">300</li><li style="color: rgb(153, 153, 153);">301</li><li style="color: rgb(153, 153, 153);">302</li><li style="color: rgb(153, 153, 153);">303</li><li style="color: rgb(153, 153, 153);">304</li><li style="color: rgb(153, 153, 153);">305</li><li style="color: rgb(153, 153, 153);">306</li><li style="color: rgb(153, 153, 153);">307</li><li style="color: rgb(153, 153, 153);">308</li><li style="color: rgb(153, 153, 153);">309</li><li style="color: rgb(153, 153, 153);">310</li><li style="color: rgb(153, 153, 153);">311</li><li style="color: rgb(153, 153, 153);">312</li></ul></pre>
<p>在这里还要注意的是，无论使用GPIO模拟方式还是自带的SPI片内外设，都要对STM32进行IO口初始化。<br>
好了，先对SPI通信协议介绍到这里。最后，给自己加一项任务，后面博客我会专门写一篇关于linux下SPI子系统的文章。</p>

                            </div>
        <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-b6c3c6d139.css" rel="stylesheet">
                                        <div class="more-toolbox">
        <div class="left-toolbox">
            <ul class="toolbox-list">
                
                <li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true">
                    <use xlink:href="#csdnc-thumbsup"></use>
                </svg><span class="name">点赞</span>
                <span class="count"></span>
                </a></li>
                <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click="{&quot;mod&quot;:&quot;popu_824&quot;}"><svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-csdnc-Collection-G"></use>
                </svg><span class="name">收藏</span></a></li>
                <li class="tool-item tool-active is-share"><a href="javascript:;" data-report-click="{&quot;mod&quot;:&quot;1582594662_002&quot;}"><svg class="icon" aria-hidden="true">
                    <use xlink:href="#icon-csdnc-fenxiang"></use>
                </svg>分享</a></li>
                <!--打赏开始-->
                                        <!--打赏结束-->
                                        <li class="tool-item tool-more">
                    <a>
                    <svg t="1575545411852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5718"></path><path d="M509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5719"></path><path d="M846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5720"></path></svg>
                    </a>
                    <ul class="more-box">
                        <li class="item"><a class="article-report">文章举报</a></li>
                    </ul>
                </li>
                                    </ul>
        </div>
                    </div>
    <div class="person-messagebox">
        <div class="left-message"><a href="https://blog.csdn.net/renqingxin2011">
            <img src="https://profile.csdnimg.cn/7/2/1/3_renqingxin2011" class="avatar_pic" username="renqingxin2011">
                                    <img src="https://g.csdnimg.cn/static/user-reg-year/2x/4.png" class="user-years">
                            </a></div>
        <div class="middle-message">
                                <div class="title"><span class="tit"><a href="https://blog.csdn.net/renqingxin2011" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}" target="_blank">rqx19910206</a></span>
                                    </div>
            <div class="text"><span>发布了9 篇原创文章</span> · <span>获赞 11</span> · <span>访问量 3459</span></div>
        </div>
                        <div class="right-message">
                                    <a href="https://im.csdn.net/im/main.html?userName=renqingxin2011" target="_blank" class="btn btn-sm btn-red-hollow bt-button personal-letter">私信
                </a>
                                                    <a class="btn btn-sm  bt-button personal-watch" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}">关注</a>
                            </div>
                    </div>
            </div>
</article>

</div>


                


<script>
$("#blog_detail_zk_collection").click(function(){
window.csdn.articleCollection()
})
</script>

    <div id="dmp_ad_58"><div id="kp_box_58" data-pid="58"><script type="text/javascript">
(function() {
    var s = "_" + Math.random().toString(36).slice(2);
    document.write('<div style="" id="' + s + '"></div>');
    (window.slotbydup = window.slotbydup || []).push({
        id: "u3501897",
        container: s
    });
})();
</script><div style="" id="_u32k6u4tdsp"><iframe id="iframeu3501897_0" name="iframeu3501897_0" src="https://pos.baidu.com/bcbm?conwid=1010&amp;conhei=90&amp;rdid=3501897&amp;dc=3&amp;exps=110011&amp;psi=ec312a901a18d3a23da031ceffba6e24&amp;di=u3501897&amp;dri=0&amp;dis=0&amp;dai=1&amp;ps=2302x377&amp;enu=encoding&amp;ant=0&amp;dcb=___adblockplus_&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1583835631045&amp;ti=SPI%E6%80%BB%E7%BA%BF%E5%8D%8F%E8%AE%AE%E8%AF%A6%E8%A7%A3%E5&amp;ari=2&amp;ver=0304&amp;dbv=2&amp;drs=3&amp;pcs=1250x684&amp;pss=1250x5918&amp;cfv=0&amp;cpl=3&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1583835631&amp;prot=2&amp;rw=684&amp;ltu=https%3A%2F%2Fblog.csdn.net%2Frenqingxin2011%2Farticle%2Fdetails%2F91047802&amp;ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;lcr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;ecd=1&amp;uc=1280x770&amp;pis=-1x-1&amp;sr=1280x800&amp;tcn=1583835631&amp;qn=2667ef99a94e3210&amp;tt=1583835630994.56.56.56" width="1010" height="90" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:1010px;height:90px" allowtransparency="true"></iframe></div>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer">
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=58&amp;a=386&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=432943474ef541efb0784eb0d2f224b8" src="https://kunyu.csdn.net/1.png?p=58&amp;a=386&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=432943474ef541efb0784eb0d2f224b8"></div></div>            
    <a id="commentBox" name="commentBox"></a>
<div class="comment-box">
<div class="comment-edit-box d-flex">
<a id="commentsedit"></a>
<div class="user-img">
    <a href="//me.csdn.net/huaweimalegebi" target="_blank" rel="noopener">
        <img class="" src="https://profile.csdnimg.cn/3/C/3/3_huaweimalegebi">
    </a>
</div>
<form id="commentform">
    <input type="hidden" id="comment_replyId">
    <textarea class="comment-content" name="comment_content" id="comment_content" placeholder="想对作者说点什么" maxlength="1000"></textarea>
    <div class="opt-box"> <!-- d-flex -->
        <div id="ubbtools" class="add_code">
            <a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
        </div>
        <input type="hidden" id="comment_replyId" name="comment_replyId">
        <input type="hidden" id="article_id" name="article_id" value="91047802">
        <input type="hidden" id="comment_userId" name="comment_userId" value="">
        <input type="hidden" id="commentId" name="commentId" value="">
        <div style="display: none;" class="csdn-tracking-statistics tracking-click" data-report-click="{&quot;mod&quot;:&quot;popu_384&quot;,&quot;dest&quot;:&quot;&quot;}"><a href="#" target="_blank" class="comment_area_btn" rel="noopener">发表评论</a></div>
        <div class="dropdown" id="myDrap">
            <a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
            <div class="txt-selected text-truncate">添加代码片</div>
            <svg class="icon d-block" aria-hidden="true">
                <use xlink:href="#csdnc-triangledown"></use>
            </svg>
            </a>
            <ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
                <li><a data-code="html">HTML/XML</a></li>
                <li><a data-code="objc">objective-c</a></li>
                <li><a data-code="ruby">Ruby</a></li>
                <li><a data-code="php">PHP</a></li>
                <li><a data-code="csharp">C</a></li>
                <li><a data-code="cpp">C++</a></li>
                <li><a data-code="javascript">JavaScript</a></li>
                <li><a data-code="python">Python</a></li>
                <li><a data-code="java">Java</a></li>
                <li><a data-code="css">CSS</a></li>
                <li><a data-code="sql">SQL</a></li>
                <li><a data-code="plain">其它</a></li>
            </ul>
        </div>  
        <div class="right-box">
                                <span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
            <input type="button" class="btn btn-sm btn-cancel d-none" value="取消回复">
            <a data-report-click="{&quot;mod&quot;:&quot;1582594662_003&quot;}"><input type="submit" class="btn btn-sm btn-red btn-comment" value="发表评论"></a>
        </div>
    </div>
</form>
</div>

<div class="comment-list-container">
<a id="comments"></a>
<div class="comment-list-box">
</div>
<div id="commentPage" class="pagination-box d-none"></div>
<div class="opt-box text-center">
    <div class="btn btn-sm btn-link-blue" id="btnMoreComment"></div>
</div>
</div>
</div>
    <div class="recommend-box">
                            <div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/a827415225/article/details/73526809" target="_blank" rel="noopener" title="STM32 的SPI读写函数解析" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;1&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/a827415225\/article\/details\/73526809&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32 的SPI读写函数解析		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">06-21</span>
        <span class="read-num hover-hide">
            阅读数 
            9591</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/a827415225/article/details/73526809" target="_blank" rel="noopener" title="STM32 的SPI读写函数解析">
        <span class="desc oneline">//SPIx&nbsp;读写一个字节//TxData:要写入的字节//返回值:读取到的字节u8 SPIx_ReadWriteByte(u8 TxData){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/a827415225">来自：	<span class="blog_title"> a827415225的专栏</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/u012075442/article/details/53821025" target="_blank" rel="noopener" title="SPI协议内容及STM32 SPI的操作" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;2&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/u012075442\/article\/details\/53821025&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI协议内容及STM32 SPI的操作		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">12-22</span>
        <span class="read-num hover-hide">
            阅读数 
            1181</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/u012075442/article/details/53821025" target="_blank" rel="noopener" title="SPI协议内容及STM32 SPI的操作">
        <span class="desc oneline">SPI总线协议简介及内容简介  SPI，是英语Serial Peripheral Interface的缩写，顾名思义就是串行外围设备接口。SPI，是一种高速的，全/半双工，同步的通信总线，并且在芯片的...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/u012075442">来自：	<span class="blog_title"> Moon~</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box recommend-box-ident recommend-download-box clearfix">
<a href="https://download.csdn.net/download/drjiachen/11608984" rel="noopener" target="_blank" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;3&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/download.csdn.net\/download\/drjiachen\/11608984&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
    <div class="content clearfix">
        <div class="">
            <h4 class="text-truncate oneline clearfix">
                一个经典的SPI教程及自己写的SPI代码.zip					</h4>
            <span class="data float-right">08-24</span>
        </div>
        <div class="desc oneline">
                SPI ：Serial Peripheral Interface 串行外围设备接口 最早由Motorola 公司提出，在其MC68HCXX系列处理器上定义的。SPI接口主要应用在EEPROM,FLAS				</div>
        <span class="type-show type-show-download">下载</span>
    </div>
</a>
</div>



<div class="recommend-item-box recommend-box-ident recommend-download-box clearfix">
<a href="https://download.csdn.net/download/qq_42516458/10922633" rel="noopener" target="_blank" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;4&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/download.csdn.net\/download\/qq_42516458\/10922633&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
    <div class="content clearfix">
        <div class="">
            <h4 class="text-truncate oneline clearfix">
                STM32经典SPI程序					</h4>
            <span class="data float-right">01-17</span>
        </div>
        <div class="desc oneline">
                STM32经典SPI程序代码，SPI时序代码准确，整个程序注释清晰。代码移植性方便。				</div>
        <span class="type-show type-show-download">下载</span>
    </div>
</a>
</div>

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_59" data-pid="59"><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" style="display: block; height: 92px; width: 712px;" data-ad-format="fluid" data-ad-layout-key="-hk-b+1w-4q+5k" data-ad-client="ca-pub-1076724771190722" data-ad-slot="3967051353" data-adsbygoogle-status="done"><ins id="aswift_1_expand" style="display: inline-table; border: none; height: 92px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 712px; background-color: transparent;"><ins id="aswift_1_anchor" style="display: block; border: none; height: 92px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 712px; background-color: transparent; overflow: hidden;"><iframe width="712" height="92" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_1" name="aswift_1" style="left: 0px; position: absolute; top: 0px; border: 0px; width: 712px; height: 92px;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=59&amp;a=731&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=9514f680e0d445a4be3ca043b10d3772" src="https://kunyu.csdn.net/1.png?p=59&amp;a=731&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=9514f680e0d445a4be3ca043b10d3772"></div></div>

<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_34133436/article/details/104327313" target="_blank" rel="noopener" title="SPI通信协议详解 采样与输出" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;5&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_34133436\/article\/details\/104327313&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI通信协议详解 采样与输出		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">02-15</span>
        <span class="read-num hover-hide">
            阅读数 
            10</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_34133436/article/details/104327313" target="_blank" rel="noopener" title="SPI通信协议详解 采样与输出">
        <span class="desc oneline">SPI总线是Motorola公司推出的三线同步接口，同步串行3线方式进行通信:一条时钟线SCK，一条数据输入线MOSI，一条数据输出线MISO；用于 CPU与各种外围器件进行全双工、同步串行通讯。SP...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_34133436">来自：	<span class="blog_title"> qq_34133436的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box recommend-box-ident recommend-download-box clearfix">
<a href="https://download.csdn.net/download/qq_41215144/10840117" rel="noopener" target="_blank" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;6&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/download.csdn.net\/download\/qq_41215144\/10840117&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
    <div class="content clearfix">
        <div class="">
            <h4 class="text-truncate oneline clearfix">
                SPI通信代码					</h4>
            <span class="data float-right">12-10</span>
        </div>
        <div class="desc oneline">
                把两个MCU的P1.2 P1.3 P1.4 P1.5分别同名端连接, 两个MCU分别连接两个PC串口A和B，就可以用串口助手测试了. 电脑串口A发给MCU-A, MCU-A把收到的数据通过SPI发给M				</div>
        <span class="type-show type-show-download">下载</span>
    </div>
</a>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_34377065/article/details/94022541" target="_blank" rel="noopener" title="SPI协议" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;7&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_34377065\/article\/details\/94022541&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI协议		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">02-01</span>
        <span class="read-num hover-hide">
            阅读数 
            270</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_34377065/article/details/94022541" target="_blank" rel="noopener" title="SPI协议">
        <span class="desc oneline">SPI，是英语Serial Peripheral interface的缩写，顾名思义就是串行外围设备接口。是Motorola首先在其MC68HCXX系列处理器上定义的。SPI接口主要应用在 EEPRO...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_34377065">来自：	<span class="blog_title"> weixin_34377065的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/lly_3485390095/article/details/83474658" target="_blank" rel="noopener" title="STM32 SPI通信协议总结" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;8&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/lly_3485390095\/article\/details\/83474658&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32 SPI通信协议总结		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">10-28</span>
        <span class="read-num hover-hide">
            阅读数 
            887</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/lly_3485390095/article/details/83474658" target="_blank" rel="noopener" title="STM32 SPI通信协议总结">
        <span class="desc oneline">简介&nbsp; &nbsp; &nbsp;&nbsp; SPI是一种高速的，全双工，同步的通信总线，并且在芯片的管脚上只占用四根线，以主从方式工作，这种模式通常有一个主设备和一个或多个从设备，需要至少4根线，事实上3根也可以（单向传输时）...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/lly_3485390095">来自：	<span class="blog_title"> lly_3485390095的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/u013752691/article/details/20002595" target="_blank" rel="noopener" title="SPI总线协议及SPI时序图详解" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;9&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/u013752691\/article\/details\/20002595&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI总线协议及SPI时序图详解		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">02-26</span>
        <span class="read-num hover-hide">
            阅读数 
            1074</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/u013752691/article/details/20002595" target="_blank" rel="noopener" title="SPI总线协议及SPI时序图详解">
        <span class="desc oneline">转自:http://pcwebmaster.blog.163.com/blog/static/283694702009114102956592/SPI，是英语Serial Peripheral Int...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/u013752691">来自：	<span class="blog_title"> Flyheart的专栏</span></a>
                                        </span>
</p>
</div>
</div>

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_60" data-pid="60"><script type="text/javascript">
(function() {
    var s = "_" + Math.random().toString(36).slice(2);
    document.write('<div style="" id="' + s + '"></div>');
    (window.slotbydup = window.slotbydup || []).push({
        id: "u3501897",
        container: s
    });
})();
</script><div style="" id="_xoi4j67xn3r"><iframe id="iframeu3501897_1" name="iframeu3501897_1" src="https://pos.baidu.com/bcbm?conwid=1010&amp;conhei=90&amp;rdid=3501897&amp;dc=3&amp;exps=110011&amp;psi=ec312a901a18d3a23da031ceffba6e24&amp;di=u3501897&amp;dri=1&amp;dis=0&amp;dai=2&amp;ps=3231x401&amp;enu=encoding&amp;ant=0&amp;dcb=___adblockplus_&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1583835631045&amp;ti=SPI%E6%80%BB%E7%BA%BF%E5%8D%8F%E8%AE%AE%E8%AF%A6%E8%A7%A3%E5&amp;ari=2&amp;ver=0304&amp;dbv=2&amp;drs=3&amp;pcs=1250x667&amp;pss=1387x6009&amp;cfv=0&amp;cpl=3&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1583835631&amp;prot=2&amp;rw=684&amp;ltu=https%3A%2F%2Fblog.csdn.net%2Frenqingxin2011%2Farticle%2Fdetails%2F91047802&amp;ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;lcr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;ecd=1&amp;uc=1280x770&amp;pis=-1x-1&amp;sr=1280x800&amp;tcn=1583835631&amp;qn=0e0cff4a4e4c9c56&amp;tt=1583835630994.68.68.68" width="1010" height="90" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:1010px;height:90px" allowtransparency="true"></iframe></div>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer">
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=60&amp;a=386&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=0efd74b0f5c748d9b9a5330f3ab09ed1" src="https://kunyu.csdn.net/1.png?p=60&amp;a=386&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=0efd74b0f5c748d9b9a5330f3ab09ed1"></div></div>

<div class="recommend-item-box recommend-box-ident recommend-download-box clearfix">
<a href="https://download.csdn.net/download/zldy0438/11565053" rel="noopener" target="_blank" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;10&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/download.csdn.net\/download\/zldy0438\/11565053&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;10&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/download.csdn.net\/download\/zldy0438\/11565053&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
    <div class="content clearfix">
        <div class="">
            <h4 class="text-truncate oneline clearfix">
                STM32 SPI 控制器驱动程序					</h4>
            <span class="data float-right">08-16</span>
        </div>
        <div class="desc oneline">
                通过STM32 SPI控制器实现的SPI master，能够对一般的SPI device进行访问，希望能够帮助到大家，谢谢				</div>
        <span class="type-show type-show-download">下载</span>
    </div>
</a>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/pxy198831/article/details/89515544" target="_blank" rel="noopener" title="STM32 同一组SPI总线上挂接不同协议的SPI芯片的问题" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;11&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/pxy198831\/article\/details\/89515544&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;11&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/pxy198831\/article\/details\/89515544&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32 同一组SPI总线上挂接不同协议的SPI芯片的问题		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-25</span>
        <span class="read-num hover-hide">
            阅读数 
            380</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/pxy198831/article/details/89515544" target="_blank" rel="noopener" title="STM32 同一组SPI总线上挂接不同协议的SPI芯片的问题">
        <span class="desc oneline">笔者最近工作的时候遇到了同一组SPI总线挂接了两种SPI芯片，一种是上升沿获取数据，一种是下降沿获取数据。明明有其他SPI总线可以用，在此就不吐槽硬件同学了。由于这两个芯片在程序运行中会反复查询，所以...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/pxy198831">来自：	<span class="blog_title"> 爱笑运气就不会太差</span></a>
                                        </span>
</p>
</div>
</div>


    <div class="recommend-item-box blog-expert-recommend-box" style="display: block;">
    <div class="d-flex">
        <div class="blog-expert-recommend">
            <div class="blog-expert">
                <div class="blog-expert-flexbox" data-report-view="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/a827415225" target="_blank"><img src="https://profile.csdnimg.cn/E/B/7/3_a827415225" username="a827415225" alt="a827415225" title="a827415225"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="a827415225" data-nick="a827415225">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/a827415225" target="_blank"><h5 class="oneline" title="a827415225">a827415225</h5></a></span>  <p></p><p class="article-num" title="84篇文章"> 84篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/u012075442" target="_blank"><img src="https://profile.csdnimg.cn/F/A/E/3_u012075442" username="u012075442" alt="Moon~" title="Moon~"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="u012075442" data-nick="Moon~">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/u012075442" target="_blank"><h5 class="oneline" title="Moon~">Moon~</h5></a></span>  <p></p><p class="article-num" title="19篇文章"> 19篇文章</p><p class="article-num" title="排名:千里之外"> 排名:千里之外</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/drjiachen" target="_blank"><img src="https://profile.csdnimg.cn/5/B/D/3_drjiachen" username="drjiachen" alt="drjiachen" title="drjiachen"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="drjiachen" data-nick="drjiachen">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/drjiachen" target="_blank"><h5 class="oneline" title="drjiachen">drjiachen</h5></a></span>  <p></p><p class="article-num" title="0篇文章"> 0篇文章</p><p class="article-num" title="排名:0"> 排名:0</p><p></p></div></div></div><div class="blog-expert-item"><div class="blog-expert-info-box"><div class="blog-expert-img-box" data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/qq_42516458" target="_blank"><img src="https://profile.csdnimg.cn/F/A/D/3_qq_42516458" username="qq_42516458" alt="吹起的泡泡" title="吹起的泡泡"></a><span data-report-click="{&quot;mod&quot;:&quot;popu_710&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><span class="blog-expert-button-follow btn-red-follow" data-name="qq_42516458" data-nick="吹起的泡泡">关注</span></span></div><div class="info"><span data-report-click="{&quot;mod&quot;:&quot;popu_709&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/renqingxin2011/article/details/91047802&quot;}"><a href="https://blog.csdn.net/qq_42516458" target="_blank"><h5 class="oneline" title="吹起的泡泡">吹起的泡泡</h5></a></span>  <p></p><p class="article-num" title="0篇文章"> 0篇文章</p><p class="article-num" title="排名:0"> 排名:0</p><p></p></div></div></div></div>
            </div>
        </div>
    </div>
</div>

<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/ivy_reny/article/details/78189058" target="_blank" rel="noopener" title="SPI总线协议" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;12&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/ivy_reny\/article\/details\/78189058&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;12&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/ivy_reny\/article\/details\/78189058&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI总线协议		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">10-10</span>
        <span class="read-num hover-hide">
            阅读数 
            1万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/ivy_reny/article/details/78189058" target="_blank" rel="noopener" title="SPI总线协议">
        <span class="desc oneline">一、概述&nbsp; &nbsp; &nbsp; &nbsp; SPI（Serial Peripheral Interface，串行外围设备接口），是Motorola公司提出的一种同步串行接口技术，是一种高速、全双工、同步通信总线，在芯片中...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/ivy_reny">来自：	<span class="blog_title"> ivy_reny的专栏</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_40185666/article/details/89296940" target="_blank" rel="noopener" title="【嵌入式】STM32实现SPI双机通信的一些细节（1）" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;13&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_40185666\/article\/details\/89296940&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;13&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_40185666\/article\/details\/89296940&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        【嵌入式】STM32实现SPI双机通信的一些细节（1）		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-14</span>
        <span class="read-num hover-hide">
            阅读数 
            1786</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_40185666/article/details/89296940" target="_blank" rel="noopener" title="【嵌入式】STM32实现SPI双机通信的一些细节（1）">
        <span class="desc oneline">STM32实现SPI双机通信的一些细节（1）背景介绍双机通信需要考虑哪些内容SPI简介主从机通信构思背景介绍实现STM32F405双机通信，拥有明确的主从机关系，通信由主机控制，可以向从机写入数据或者...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_40185666">来自：	<span class="blog_title"> weixin_40185666的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/kai_zone/article/details/78038716" target="_blank" rel="noopener" title="SPI总线（一）：基本原理篇" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;14&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/kai_zone\/article\/details\/78038716&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;14&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/kai_zone\/article\/details\/78038716&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI总线（一）：基本原理篇		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">09-20</span>
        <span class="read-num hover-hide">
            阅读数 
            1万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/kai_zone/article/details/78038716" target="_blank" rel="noopener" title="SPI总线（一）：基本原理篇">
        <span class="desc oneline">&nbsp;相关文章：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SPI总线（二）：驱动分析篇&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SPI总线（三）：驱动实例&nbsp;1、什么是SPI？&nbsp;&nbsp;&nbsp;SPI是串行外设接口(SerialPeripheralInterface)的缩写。...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/kai_zone">来自：	<span class="blog_title"> 不忘初心</span></a>
                                        </span>
</p>
</div>
</div>

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_61" data-pid="61"><script type="text/javascript">
(function() {
    var s = "_" + Math.random().toString(36).slice(2);
    document.write('<div style="" id="' + s + '"></div>');
    (window.slotbydup = window.slotbydup || []).push({
        id: "u3501897",
        container: s
    });
})();
</script><div style="" id="_pjc9xtauz9p"><iframe id="iframeu3501897_2" name="iframeu3501897_2" src="https://pos.baidu.com/bcbm?conwid=1010&amp;conhei=90&amp;rdid=3501897&amp;dc=3&amp;exps=110011&amp;psi=ec312a901a18d3a23da031ceffba6e24&amp;di=u3501897&amp;dri=2&amp;dis=0&amp;dai=3&amp;ps=3836x401&amp;enu=encoding&amp;ant=0&amp;dcb=___adblockplus_&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1583835631045&amp;ti=SPI%E6%80%BB%E7%BA%BF%E5%8D%8F%E8%AE%AE%E8%AF%A6%E8%A7%A3%E5&amp;ari=2&amp;ver=0304&amp;dbv=2&amp;drs=3&amp;pcs=1250x667&amp;pss=1387x6099&amp;cfv=0&amp;cpl=3&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1583835631&amp;prot=2&amp;rw=684&amp;ltu=https%3A%2F%2Fblog.csdn.net%2Frenqingxin2011%2Farticle%2Fdetails%2F91047802&amp;ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;lcr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;ecd=1&amp;uc=1280x770&amp;pis=-1x-1&amp;sr=1280x800&amp;tcn=1583835631&amp;qn=0b50562734cff8bd&amp;tt=1583835630994.77.77.77" width="1010" height="90" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:1010px;height:90px" allowtransparency="true"></iframe></div>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer">
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=61&amp;a=386&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=05157d451aee4033877f05de1f13dd95"></div></div>

<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/jjadads/article/details/80038120" target="_blank" rel="noopener" title="io口模拟spi，stm32f103与MS5611基于spi总线的温度压力高度数据读取" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;15&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/jjadads\/article\/details\/80038120&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;15&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/jjadads\/article\/details\/80038120&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        io口模拟spi，stm32f103与MS5611基于spi总线的温度压力高度数据读取		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-22</span>
        <span class="read-num hover-hide">
            阅读数 
            2385</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/jjadads/article/details/80038120" target="_blank" rel="noopener" title="io口模拟spi，stm32f103与MS5611基于spi总线的温度压力高度数据读取">
        <span class="desc oneline">以下文件为源文件/**&nbsp;&nbsp; &nbsp;-----------------------MS5611驱动 &amp;amp;&amp;amp; IO口模拟SPI驱动------------------------...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/jjadads">来自：	<span class="blog_title"> jjadads的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_36612961/article/details/89349880" target="_blank" rel="noopener" title="SPI时序详解(附代码)" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;16&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_36612961\/article\/details\/89349880&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;16&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_36612961\/article\/details\/89349880&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI时序详解(附代码)		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-17</span>
        <span class="read-num hover-hide">
            阅读数 
            626</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_36612961/article/details/89349880" target="_blank" rel="noopener" title="SPI时序详解(附代码)">
        <span class="desc oneline">SPI四种模式详解图解及源码：//SPI的模式1:u8 SPI_ReadWriteOneByte(u8 tx_data){	u8 i,rx_data=0;	SCK=0; //空闲电平(默认初始化情况)...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_36612961">来自：	<span class="blog_title"> void*_的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/marble_xu/article/details/100129768" target="_blank" rel="noopener" title="Python 植物大战僵尸代码实现(1):图片加载和显示切换" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;17&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/marble_xu\/article\/details\/100129768&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;17&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/marble_xu\/article\/details\/100129768&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        Python 植物大战僵尸代码实现(1):图片加载和显示切换		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">08-30</span>
        <span class="read-num hover-hide">
            阅读数 
            5万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/marble_xu/article/details/100129768" target="_blank" rel="noopener" title="Python 植物大战僵尸代码实现(1):图片加载和显示切换">
        <span class="desc oneline">功能实现如下：    支持的植物类型：太阳花，豌豆射手，寒冰射手，坚果，樱桃炸弹。新增加植物：双重豌豆射手，三重豌豆射手，食人花 ，小喷菇，土豆地雷，倭瓜。    支持的僵尸类型：普通僵尸，棋子僵尸，...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/marble_xu">来自：	<span class="blog_title"> marble_xu的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_40877615/article/details/94355442" target="_blank" rel="noopener" title="SPI总线传输协议" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;18&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_40877615\/article\/details\/94355442&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;18&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_40877615\/article\/details\/94355442&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI总线传输协议		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">06-30</span>
        <span class="read-num hover-hide">
            阅读数 
            274</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_40877615/article/details/94355442" target="_blank" rel="noopener" title="SPI总线传输协议">
        <span class="desc oneline">一、SPI总线是一种高速全双工同步串行通信总线，它可以使CPU与各种外围设备以串行方式进行通信以交换信息。SPI的主要应用领域包括：EEPROM、FLASH、AD转换器、各种传感器等设备通信领域。SP...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_40877615">来自：	<span class="blog_title"> zhangxin的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/To_be_a_fisher/article/details/84329772" target="_blank" rel="noopener" title="关于stm32通信协议：软件模拟SPI、软件模拟I2C的总结（fishing_8）" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;19&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/To_be_a_fisher\/article\/details\/84329772&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;19&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/To_be_a_fisher\/article\/details\/84329772&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        关于stm32通信协议：软件模拟SPI、软件模拟I2C的总结（fishing_8）		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">11-21</span>
        <span class="read-num hover-hide">
            阅读数 
            2178</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/To_be_a_fisher/article/details/84329772" target="_blank" rel="noopener" title="关于stm32通信协议：软件模拟SPI、软件模拟I2C的总结（fishing_8）">
        <span class="desc oneline">趁着帮老师代上嵌入式实验课的机会，又重新熟悉了一遍stm32的通信协议：串口协议、SPI协议、I2C协议、RS485协议。大概半年前，是过了一遍的，但也只停留于读了遍代码，跑了下例程，最近又过了一遍（...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/To_be_a_fisher">来自：	<span class="blog_title"> To_be_a_fisher的博客</span></a>
                                        </span>
</p>
</div>
</div>

<div class="recommend-item-box recommend-recommend-box"><div id="kp_box_62" data-pid="62"><script type="text/javascript">
(function() {
    var s = "_" + Math.random().toString(36).slice(2);
    document.write('<div style="" id="' + s + '"></div>');
    (window.slotbydup = window.slotbydup || []).push({
        id: "u3501897",
        container: s
    });
})();
</script><div style="" id="_1cb6a5fxyw8"><iframe id="iframeu3501897_3" name="iframeu3501897_3" src="https://pos.baidu.com/bcbm?conwid=1010&amp;conhei=90&amp;rdid=3501897&amp;dc=3&amp;exps=110011&amp;psi=ec312a901a18d3a23da031ceffba6e24&amp;di=u3501897&amp;dri=3&amp;dis=0&amp;dai=4&amp;ps=4341x401&amp;enu=encoding&amp;ant=0&amp;dcb=___adblockplus_&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1583835631045&amp;ti=SPI%E6%80%BB%E7%BA%BF%E5%8D%8F%E8%AE%AE%E8%AF%A6%E8%A7%A3%E5&amp;ari=2&amp;ver=0304&amp;dbv=2&amp;drs=3&amp;pcs=1250x667&amp;pss=1387x6189&amp;cfv=0&amp;cpl=3&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1583835631&amp;prot=2&amp;rw=684&amp;ltu=https%3A%2F%2Fblog.csdn.net%2Frenqingxin2011%2Farticle%2Fdetails%2F91047802&amp;ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;lcr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DdDzEqKD-BwyfKN8KNZpM3t8h1ZNwzYGdgln60d-5sfLqV1m4Uebpg-c4_VxRRcF4GdgDNpl5DgFgYqJ_2rIxgCY9St6jnMhsqlEzFZLoGZm%26wd%3D%26eqid%3Dcd1ef39a0006cd67000000045e6769db&amp;ecd=1&amp;uc=1280x770&amp;pis=-1x-1&amp;sr=1280x800&amp;tcn=1583835631&amp;qn=8c55c92f090260af&amp;tt=1583835630994.88.88.88" width="1010" height="90" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" style="border:0;vertical-align:bottom;margin:0;width:1010px;height:90px" allowtransparency="true"></iframe></div>
<!-- 多条广告如下脚本只需引入一次 -->
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer">
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=62&amp;a=386&amp;c=0&amp;k=&amp;d=1&amp;t=3&amp;u=f693ab8da880436a88ea701dfbcbf3b6"></div></div>

<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/jinchengzhou/article/details/53036760" target="_blank" rel="noopener" title="stm32 华邦W25X32芯片spi总线配置" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;20&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/jinchengzhou\/article\/details\/53036760&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;20&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/jinchengzhou\/article\/details\/53036760&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        stm32 华邦W25X32芯片spi总线配置		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">11-04</span>
        <span class="read-num hover-hide">
            阅读数 
            942</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/jinchengzhou/article/details/53036760" target="_blank" rel="noopener" title="stm32 华邦W25X32芯片spi总线配置">
        <span class="desc oneline">#include&nbsp;"stm32f10x_gpio.h"#include&nbsp;"stm32f10x_spi.h" #define&nbsp;FLASH_CS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(16)#define&nbsp;SPI_FLASH_CS(...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/jinchengzhou">来自：	<span class="blog_title"> jinchengzhou的专栏</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_42108484/article/details/91474489" target="_blank" rel="noopener" title="STM32的SPI的原理与使用(W25Q128附代码)" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;21&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_42108484\/article\/details\/91474489&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;21&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_42108484\/article\/details\/91474489&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32的SPI的原理与使用(W25Q128附代码)		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">06-27</span>
        <span class="read-num hover-hide">
            阅读数 
            2198</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_42108484/article/details/91474489" target="_blank" rel="noopener" title="STM32的SPI的原理与使用(W25Q128附代码)">
        <span class="desc oneline">目录一、SPI介绍二、SPI接口框图三、SPI优缺点四、SPI工作原理总结五、时序图六、SPI程序编写过程七、W25Q12xx的原理及应用7.1分析W25Q128指令7.2擦除扇区：7.3部分常用设备...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_42108484">来自：	<span class="blog_title"> nandycooh的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qinrenzhi/article/details/79558852" target="_blank" rel="noopener" title="spi总线驱动简单代码" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;22&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qinrenzhi\/article\/details\/79558852&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;22&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qinrenzhi\/article\/details\/79558852&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        spi总线驱动简单代码		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">03-14</span>
        <span class="read-num hover-hide">
            阅读数 
            220</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qinrenzhi/article/details/79558852" target="_blank" rel="noopener" title="spi总线驱动简单代码">
        <span class="desc oneline">spi-bus.c#include &amp;lt;linux/init.h&amp;gt; &nbsp;#include &amp;lt;linux/module.h&amp;gt; &nbsp;#include &amp;a...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qinrenzhi">来自：	<span class="blog_title"> qinrenzhi的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_38491862/article/details/80110464" target="_blank" rel="noopener" title="SPI通信裸机源代码" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;23&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_38491862\/article\/details\/80110464&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;23&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_38491862\/article\/details\/80110464&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI通信裸机源代码		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-27</span>
        <span class="read-num hover-hide">
            阅读数 
            684</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_38491862/article/details/80110464" target="_blank" rel="noopener" title="SPI通信裸机源代码">
        <span class="desc oneline">SPI主模式源文件/****************************************************************************SPI模式通信SPI主模式：...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_38491862">来自：	<span class="blog_title"> neha的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/fzr_en/article/details/90171197" target="_blank" rel="noopener" title="SPI协议原理简介" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;24&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/fzr_en\/article\/details\/90171197&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;24&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/fzr_en\/article\/details\/90171197&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI协议原理简介		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">05-13</span>
        <span class="read-num hover-hide">
            阅读数 
            469</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/fzr_en/article/details/90171197" target="_blank" rel="noopener" title="SPI协议原理简介">
        <span class="desc oneline">1 SPI概述SPI：Serial Peripheral Interface，串行外围设备接口，是Motorola公司提出的一种高速、全双工、同步的通信总线。感官认识：下图是带SPI接口的实时时钟芯片...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/fzr_en">来自：	<span class="blog_title"> 匠心筑梦人</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_40185666/article/details/89315019" target="_blank" rel="noopener" title="【嵌入式】STM32实现SPI双机通信的一些细节（3）问题汇总" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;25&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_40185666\/article\/details\/89315019&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;25&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_40185666\/article\/details\/89315019&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        【嵌入式】STM32实现SPI双机通信的一些细节（3）问题汇总		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-15</span>
        <span class="read-num hover-hide">
            阅读数 
            1012</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_40185666/article/details/89315019" target="_blank" rel="noopener" title="【嵌入式】STM32实现SPI双机通信的一些细节（3）问题汇总">
        <span class="desc oneline">STM32实现SPI双机通信的一些细节（3）从机接收中断的疑问背景问题描述背景主机：初始化时只使能接收中断，需要被发送的数据准备好后，使能发送中断，立即发送；从机：初始化时使能发送、接收中断，此时会立...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_40185666">来自：	<span class="blog_title"> weixin_40185666的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/ce123/article/details/6897293" target="_blank" rel="noopener" title="SPI总线协议介绍" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;26&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/ce123\/article\/details\/6897293&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;26&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/ce123\/article\/details\/6897293&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI总线协议介绍		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">10-23</span>
        <span class="read-num hover-hide">
            阅读数 
            4万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/ce123/article/details/6897293" target="_blank" rel="noopener" title="SPI总线协议介绍">
        <span class="desc oneline">SPI总线协议介绍一、技术性能&nbsp; &nbsp; &nbsp; &nbsp; SPI接口是Motorola 首先提出的全双工三线同步串行外围接口，采用主从模式（Master Slave）架构；支持多slave模式应用，一般仅支持单M...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/ce123">来自：	<span class="blog_title"> ce123的技术博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_38639426/article/details/88633340" target="_blank" rel="noopener" title="从零开始一起学stm32（十二）---SPI协议" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;27&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_38639426\/article\/details\/88633340&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;27&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_38639426\/article\/details\/88633340&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        从零开始一起学stm32（十二）---SPI协议		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">03-18</span>
        <span class="read-num hover-hide">
            阅读数 
            184</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_38639426/article/details/88633340" target="_blank" rel="noopener" title="从零开始一起学stm32（十二）---SPI协议">
        <span class="desc oneline">SPI通信 -- W25Q64 -- flash芯片的使用1、通信协议2、SPI通信3、STM32中SPI控制器的使用4、W25Q64的操作过程以及软件编程1.通信协议：协议：两个相互通信的设备之间，...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_38639426">来自：	<span class="blog_title"> qq_38639426的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/aaronychen/article/details/2568162" target="_blank" rel="noopener" title="用GPIO模拟SPI协议的实现" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;28&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/aaronychen\/article\/details\/2568162&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;28&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/aaronychen\/article\/details\/2568162&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        用GPIO模拟SPI协议的实现		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">06-20</span>
        <span class="read-num hover-hide">
            阅读数 
            9714</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/aaronychen/article/details/2568162" target="_blank" rel="noopener" title="用GPIO模拟SPI协议的实现">
        <span class="desc oneline">用GPIO模拟SPI协议的实现一 SPI协议概括SPI，是英语Serial Peripheral interface的缩写，顾名思义就是串行外围设备接口。是Motorola首先在其MC68HCXX系列...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/aaronychen">来自：	<span class="blog_title"> aaronychen的专栏</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/tclxspy/article/details/77565137" target="_blank" rel="noopener" title="固件#02--SPI原理和代码" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;29&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/tclxspy\/article\/details\/77565137&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;29&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/tclxspy\/article\/details\/77565137&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        固件#02--SPI原理和代码		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">08-25</span>
        <span class="read-num hover-hide">
            阅读数 
            1442</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/tclxspy/article/details/77565137" target="_blank" rel="noopener" title="固件#02--SPI原理和代码">
        <span class="desc oneline">SPI接口原理和模拟代码。</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/tclxspy">来自：	<span class="blog_title"> tclxspy的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/ppdyhappy/article/details/51396277" target="_blank" rel="noopener" title="SPI总线 通俗易懂讲解" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;30&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/ppdyhappy\/article\/details\/51396277&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;30&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/ppdyhappy\/article\/details\/51396277&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI总线 通俗易懂讲解		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">05-13</span>
        <span class="read-num hover-hide">
            阅读数 
            1万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/ppdyhappy/article/details/51396277" target="_blank" rel="noopener" title="SPI总线 通俗易懂讲解">
        <span class="desc oneline">SPI总线 通俗易懂讲解</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/ppdyhappy">来自：	<span class="blog_title"> 会飞的石头</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weibo1230123/article/details/80109031" target="_blank" rel="noopener" title="STM32的SPI驱动代码" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;31&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weibo1230123\/article\/details\/80109031&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;31&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weibo1230123\/article\/details\/80109031&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32的SPI驱动代码		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-27</span>
        <span class="read-num hover-hide">
            阅读数 
            1089</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weibo1230123/article/details/80109031" target="_blank" rel="noopener" title="STM32的SPI驱动代码">
        <span class="desc oneline">https://wenku.baidu.com/view/4758081b10a6f524ccbf85b0.html</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weibo1230123">来自：	<span class="blog_title"> 魏波</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/weixin_33728708/article/details/91871197" target="_blank" rel="noopener" title="SPI 总线协议和驱动" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;32&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_33728708\/article\/details\/91871197&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;32&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/weixin_33728708\/article\/details\/91871197&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI 总线协议和驱动		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">12-23</span>
        <span class="read-num hover-hide">
            阅读数 
            718</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/weixin_33728708/article/details/91871197" target="_blank" rel="noopener" title="SPI 总线协议和驱动">
        <span class="desc oneline">2019独角兽企业重金招聘Python工程师标准&gt;&gt;&gt;                                                    ......</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_33728708">来自：	<span class="blog_title"> weixin_33728708的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_36903042/article/details/102792114" target="_blank" rel="noopener" title="大学四年，我把私藏的自学「学习网站/实用工具」都贡献出来了" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;33&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_36903042\/article\/details\/102792114&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;33&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_36903042\/article\/details\/102792114&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        大学四年，我把私藏的自学「学习网站/实用工具」都贡献出来了		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">10-29</span>
        <span class="read-num hover-hide">
            阅读数 
            16万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_36903042/article/details/102792114" target="_blank" rel="noopener" title="大学四年，我把私藏的自学「学习网站/实用工具」都贡献出来了">
        <span class="desc oneline">在分享之前，先说说初学者如何学习编程，这个话题想必非常的重要，要学好编程，给你一些学习网站也好、实用工具也好，但前提是你知道如何去学习它。见过很多初学者，以及小鹿我刚开始学习的时候，也是自己瞎摸索，找...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_36903042">来自：	<span class="blog_title"> 小鹿动画学编程</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/jingzhesiye/article/details/8021741" target="_blank" rel="noopener" title="SPI协议及其工作原理浅析" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;34&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/jingzhesiye\/article\/details\/8021741&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;34&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/jingzhesiye\/article\/details\/8021741&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI协议及其工作原理浅析		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">09-26</span>
        <span class="read-num hover-hide">
            阅读数 
            1万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/jingzhesiye/article/details/8021741" target="_blank" rel="noopener" title="SPI协议及其工作原理浅析">
        <span class="desc oneline">一、概述.&nbsp; &nbsp;&nbsp;&nbsp;SPI, Serial Perripheral Interface, 串行外围设备接口, 是 Motorola 公司推出的一种同步串行接口技术. SPI 总线在物理上是通过接在外围...</span>
    </a>
    <span class="blog_title_box oneline no-title">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/a1314521531/article/details/51035372" target="_blank" rel="noopener" title="STM32——SPI接口" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;35&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/a1314521531\/article\/details\/51035372&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;35&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/a1314521531\/article\/details\/51035372&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32——SPI接口		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">04-19</span>
        <span class="read-num hover-hide">
            阅读数 
            2万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/a1314521531/article/details/51035372" target="_blank" rel="noopener" title="STM32——SPI接口">
        <span class="desc oneline">STM32——SPI接口宗旨：技术的学习是有限的，分享的精神的无限的。一、SPI协议【SerialPeripheral Interface】&nbsp; &nbsp; &nbsp; &nbsp; 串行外围设备接口，是一种高速全双工的通信总线...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/a1314521531">来自：	<span class="blog_title"> 血染风采2019</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/oqqHuTu12345678/article/details/65445338" target="_blank" rel="noopener" title="SPI、I2C、UART（即串口）三种串行总线详解" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;36&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/oqqHuTu12345678\/article\/details\/65445338&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;36&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/oqqHuTu12345678\/article\/details\/65445338&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        SPI、I2C、UART（即串口）三种串行总线详解		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">03-23</span>
        <span class="read-num hover-hide">
            阅读数 
            4514</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/oqqHuTu12345678/article/details/65445338" target="_blank" rel="noopener" title="SPI、I2C、UART（即串口）三种串行总线详解">
        <span class="desc oneline">以下内容均来源于网络资源的学习整理，如有侵权，请告知删除。参考博客https://blog.csdn.net/xiaodingqq/article/details/80342459https://bl...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/oqqHuTu12345678">来自：	<span class="blog_title"> 清风徐来</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_43743762/article/details/98946574" target="_blank" rel="noopener" title="STM32—SPI详解" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;37&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_43743762\/article\/details\/98946574&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;37&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_43743762\/article\/details\/98946574&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        STM32—SPI详解		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">08-09</span>
        <span class="read-num hover-hide">
            阅读数 
            824</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_43743762/article/details/98946574" target="_blank" rel="noopener" title="STM32—SPI详解">
        <span class="desc oneline">目录一.什么是SPI二.SPI协议物理层协议层1.通讯时序图2.起始和停止信号3.数据有效性4.通讯模式三.STM32中的SPI简介功能框图1.通讯引脚2.时钟控制逻辑3.数据控制逻辑4.整体逻辑控制...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_43743762">来自：	<span class="blog_title"> 蜡笔小新没有博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_41550197/article/details/80989140" target="_blank" rel="noopener" title="stm32与FPGA通信代码实现方案spi（对初学者实用）" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;38&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_41550197\/article\/details\/80989140&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;38&quot;,&quot;strategy&quot;:&quot;BlogCommendFromMachineLearnPai2&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_41550197\/article\/details\/80989140&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        stm32与FPGA通信代码实现方案spi（对初学者实用）		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">07-10</span>
        <span class="read-num hover-hide">
            阅读数 
            1万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_41550197/article/details/80989140" target="_blank" rel="noopener" title="stm32与FPGA通信代码实现方案spi（对初学者实用）">
        <span class="desc oneline">/*------------以下是FPGA与微控制器通信SPI模块的编程思路-分析-----------------------------------------------------------...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_41550197">来自：	<span class="blog_title"> qq_41550197的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/qq_44543508/article/details/102651841" target="_blank" rel="noopener" title="Java学习的正确打开方式" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;39&quot;,&quot;strategy&quot;:&quot;BlogCommendHotData&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_44543508\/article\/details\/102651841&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;39&quot;,&quot;strategy&quot;:&quot;BlogCommendHotData&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/qq_44543508\/article\/details\/102651841&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        Java学习的正确打开方式		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">01-08</span>
        <span class="read-num hover-hide">
            阅读数 
            30万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/qq_44543508/article/details/102651841" target="_blank" rel="noopener" title="Java学习的正确打开方式">
        <span class="desc oneline">在博主认为，对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结，前三者博主将淋漓尽致地挥毫于这篇博客文章中，至于总结在于个人，实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_44543508">来自：	<span class="blog_title"> 程序员宜春的博客</span></a>
                                        </span>
</p>
</div>
</div>



<div class="recommend-item-box type_blog clearfix">
<div class="content" style="width: 712px;">
<a href="https://blog.csdn.net/m0_37907797/article/details/102661778" target="_blank" rel="noopener" title="程序员必须掌握的核心算法有哪些？" data-report-click="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;40&quot;,&quot;strategy&quot;:&quot;BlogCommendHotData&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/m0_37907797\/article\/details\/102661778&quot;}" data-report-view="{&quot;mod&quot;:&quot;popu_387&quot;,&quot;index&quot;:&quot;40&quot;,&quot;strategy&quot;:&quot;BlogCommendHotData&quot;,&quot;dest&quot;:&quot;https:\/\/blog.csdn.net\/m0_37907797\/article\/details\/102661778&quot;}" data-report-query="depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task">
<h4 class="text-truncate oneline" style="width: 552px;">
        程序员必须掌握的核心算法有哪些？		</h4>
<div class="info-box d-flex align-content-center">
    <p class="date-and-readNum oneline">
        <span class="date hover-show">12-26</span>
        <span class="read-num hover-hide">
            阅读数 
            42万+</span>
        </p>
    </div>
</a>
<p class="content" style="width: 712px;">
    <a href="https://blog.csdn.net/m0_37907797/article/details/102661778" target="_blank" rel="noopener" title="程序员必须掌握的核心算法有哪些？">
        <span class="desc oneline">由于我之前一直强调数据结构以及算法学习的重要性，所以就有一些读者经常问我，数据结构与算法应该要学习到哪个程度呢？，说实话，这个问题我不知道要怎么回答你，主要取决于你想学习到哪些程度，不过针对这个问题，...</span>
    </a>
    <span class="blog_title_box oneline ">
                            <span class="type-show type-show-blog type-show-after">博文</span>
                                    <a target="_blank" rel="noopener" href="https://blog.csdn.net/m0_37907797">来自：	<span class="blog_title"> 帅地</span></a>
                                        </span>
</p>
</div>
</div>



            <div class="recommend-item-box type_hot_word">
            <div class="content clearfix" style="width: 712px;">
                <div class="float-left">
                                                                        <span>
                        <a href="https://blog.csdn.net/yilovexing/article/details/80577510" target="_blank">
                        python</a>
                    </span>
                                                <span>
                        <a href="https://blog.csdn.net/slwbcsdn/article/details/53458352" target="_blank">
                        json</a>
                    </span>
                                                <span>
                        <a href="https://blog.csdn.net/csdnnews/article/details/83753246" target="_blank">
                        java</a>
                    </span>
                                                <span>
                        <a href="https://blog.csdn.net/qq_35077512/article/details/88952519" target="_blank">
                        mysql</a>
                    </span>
                                                <span>
                        <a href="https://blog.csdn.net/pdcfighting/article/details/80297499" target="_blank">
                        pycharm</a>
                    </span>
                                                <span>
                        <a href="https://blog.csdn.net/sinyu890807/article/details/97142065" target="_blank">
                        android</a>
                    </span>
                                                <span>
                        <a href="https://blog.csdn.net/gexiaoyizhimei/article/details/100122368" target="_blank">
                        linux</a>
                    </span>
                                                <span>
                        <a href="https://download.csdn.net/download/xhg_gszs/10978826" target="_blank">
                        json格式</a>
                    </span>
                                            
                                                                        <span>
                        <a href="https://www.csdn.net/gather_1d/NtzakgzsLWRvd25sb2Fk.html" target="_blank">
                        c# mvc 接口开发</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_18/Ntzakg0sLWRvd25sb2Fk.html" target="_blank">
                        c#与mysql数据库</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_17/Ntzakg1sLWRvd25sb2Fk.html" target="_blank">
                        c#截取字符串倒数第三位</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_13/Ntzakg2sLWRvd25sb2Fk.html" target="_blank">
                        c#滚动抽奖</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_1b/Ntzakg3sLWRvd25sb2Fk.html" target="_blank">
                        c# 变量栈大小</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_19/Ntzakg4sLWRvd25sb2Fk.html" target="_blank">
                        c#前端界面栏位有数据值</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_12/Ntzakg5sLWRvd25sb2Fk.html" target="_blank">
                        c# 文件保存到数据库</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_11/OtDaAgxsLWRvd25sb2Fk.html" target="_blank">
                        c# 打印窗口</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_11/OtDaAgzsLWRvd25sb2Fk.html" target="_blank">
                        c#项目开发实例</a>
                    </span>
                                                <span>
                        <a href="https://www.csdn.net/gather_18/OtDaAg1sLWRvd25sb2Fk.html" target="_blank">
                        c# orm框架对比</a>
                    </span>
                                                                    </div>
            </div>
            </div>
                            <div class="recommend-loading-box">
            <img src="https://csdnimg.cn/release/phoenix/images/feedLoading.gif">
        </div>
        <div class="recommend-end-box">
            <p class="text-center">没有更多推荐了，<a href="https://blog.csdn.net/" class="c-blue c-blue-hover c-blue-focus">返回首页</a></p>
        </div>
    </div>
                    <div class="template-box">
            <span>©️2019 CSDN</span><span class="point"></span>
        <span>皮肤主题: 创作都市</span>
        <span> 设计师:
                                    CSDN官方博客                                    </span>
        </div>
            </main>